FS-3881 try this, i think the contact in the notify is causing the phone to change the destination for future subs

This commit is contained in:
Anthony Minessale 2012-02-06 11:59:57 -06:00
parent 6767683711
commit 9b086c4bea
1 changed files with 23 additions and 1 deletions

View File

@ -1835,7 +1835,7 @@ static void _send_presence_notify(sofia_profile_t *profile,
sofia_destination_t *dst = NULL;
char *contact_str, *contact, *user_via = NULL;
char *route_uri = NULL, *o_contact_dup = NULL, *tmp;
char *route_uri = NULL, *o_contact_dup = NULL, *tmp, *to_uri, *dcs = NULL;
const char *tp;
tmp = (char *)o_contact;
@ -1882,6 +1882,27 @@ static void _send_presence_notify(sofia_profile_t *profile,
} else {
contact_str = our_contact;
}
if ((to_uri = sofia_glue_get_url_from_contact((char *)full_to, 1))) {
char *p;
if ((p = strstr(to_uri, "sip:"))) {
char *q;
p += 4;
if ((q = strchr(p, '@'))) {
*q++ = '\0';
if ((dcs = switch_string_replace(contact_str, "mod_sofia", p))) {
contact_str = dcs;
}
}
}
free(to_uri);
}
dst = sofia_glue_get_destination((char *) o_contact);
switch_assert(dst);
@ -1980,6 +2001,7 @@ static void _send_presence_notify(sofia_profile_t *profile,
switch_safe_free(route_uri);
switch_safe_free(dcs);
switch_safe_free(contact);
sofia_glue_free_destination(dst);