]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6085 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 28 Jan 2014 16:55:56 +0000 (21:55 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 28 Jan 2014 16:56:02 +0000 (21:56 +0500)
src/mod/endpoints/mod_sofia/sofia_presence.c

index 138f4ff2719cc530119854f7be47df96e580ac2d..d38ded2927ef17e57d583f63d9e042891f664c29 100644 (file)
@@ -3588,6 +3588,7 @@ void sofia_presence_handle_sip_i_subscribe(int status,
        const char *use_to_tag;
        char to_tag[13] = "";
        char buf[80] = "";
+       char *orig_to_user = NULL;
 
        if (!sip) {
                return;
@@ -3713,6 +3714,8 @@ void sofia_presence_handle_sip_i_subscribe(int status,
                }
        }
 
+       orig_to_user = su_strdup(nua_handle_home(nh), to_user);
+
        if (to_user && strchr(to_user, '+')) {
                char *h;
                if ((proto = (d_user = strdup(to_user)))) {
@@ -3922,9 +3925,9 @@ void sofia_presence_handle_sip_i_subscribe(int status,
 
                if (contactstr && (p = strchr(contactstr, '@'))) {
                        if (strrchr(p, '>')) {
-                               new_contactstr = switch_mprintf("<sip:%s%s", to_user, p);
+                               new_contactstr = switch_mprintf("<sip:%s%s", orig_to_user, p);
                        } else {
-                               new_contactstr = switch_mprintf("<sip:%s%s>", to_user, p);
+                               new_contactstr = switch_mprintf("<sip:%s%s>", orig_to_user, p);
                        }
                }