]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3881 try this, i think the contact in the notify is causing the phone to change...
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 6 Feb 2012 17:59:57 +0000 (11:59 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 6 Feb 2012 17:59:57 +0000 (11:59 -0600)
src/mod/endpoints/mod_sofia/sofia_presence.c

index 2818d7c5f687dd053d28dca60f57e66016426719..75c663ef0703c3583357778f77f05279f4932cc5 100644 (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);