]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5094 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 12 Feb 2013 15:21:17 +0000 (09:21 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 12 Feb 2013 15:21:21 +0000 (09:21 -0600)
src/mod/endpoints/mod_sofia/sofia_glue.c

index 85c08099dfedba1968814fee2f5ca6b31dde49b5..61f069e22b35190b5938d18bcacf10b059c4d8df 100644 (file)
@@ -7090,7 +7090,21 @@ char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, nua
                np->is_nat = NULL;
        }
 
-       if (np->is_nat && np->fs_path) {
+       if (sip->sip_record_route && sip->sip_record_route->r_url) {
+               char *full_contact = sip_header_as_string(nh->nh_home, (void *) contact);
+               char *route = sofia_glue_strip_uri(sip_header_as_string(nh->nh_home, (void *) sip->sip_record_route));
+               char *full_contact_dup;
+               char *route_encoded;
+               int route_encoded_len;
+               full_contact_dup = sofia_glue_get_url_from_contact(full_contact, 1);
+               route_encoded_len = (int)(strlen(route) * 3) + 1;
+               switch_zmalloc(route_encoded, route_encoded_len);
+               switch_url_encode(route, route_encoded, route_encoded_len);
+               contact_str = switch_mprintf("%s <%s;fs_path=%s>", display, full_contact_dup, route_encoded);
+               free(full_contact_dup);
+               free(route_encoded);
+       }
+       else if (np->is_nat && np->fs_path) {
                char *full_contact = sip_header_as_string(nh->nh_home, (void *) contact);
                char *full_contact_dup;
                char *path_encoded;