]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
make register-proxy preserve the url composed from proxy but target the packets to...
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 1 Aug 2008 18:18:35 +0000 (18:18 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 1 Aug 2008 18:18:35 +0000 (18:18 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9219 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_reg.c

index 8c88d1ed077d077b39e643074b190cd44bea8dfc..6a395057f868ce10998603219de3a2aa0b1df982 100644 (file)
@@ -274,6 +274,7 @@ struct sofia_gateway {
        char *register_contact;
        char *register_to;
        char *register_proxy;
+       char *register_sticky_proxy;
        char *register_context;
        char *expires_str;
        char *register_url;
index 118742d51a0906c16d9d69afac9d587547dd64b3..7aa3673069af7e5f892272152c2dd72b022e6a63 100644 (file)
@@ -886,8 +886,8 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
                                from_domain = realm;
                        }
 
-                       if (switch_strlen_zero(register_proxy)) {
-                               register_proxy = proxy;
+                       if (!switch_strlen_zero(register_proxy)) {
+                               gateway->register_sticky_proxy = switch_core_strdup(gateway->pool, register_proxy);
                        }
 
                        gateway->retry_seconds = atoi(retry_seconds);
@@ -914,7 +914,7 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
                                params = switch_core_sprintf(gateway->pool, ";transport=%s", register_transport);
                        }
 
-                       gateway->register_url = switch_core_sprintf(gateway->pool, "sip:%s;transport=%s", register_proxy, register_transport);
+                       gateway->register_url = switch_core_sprintf(gateway->pool, "sip:%s;transport=%s", proxy, register_transport);
                        gateway->register_from = switch_core_sprintf(gateway->pool, "<sip:%s@%s;transport=%s>", from_user, from_domain, register_transport);
 
                        sipip = profile->extsipip ?  profile->extsipip : profile->sipip;
index 767ec34afee7d65e260a40099341233f83a0a675..ca741c089e2c0b1a7a8a19f23cd2a8941295430f 100644 (file)
@@ -150,6 +150,7 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
                                if (now) {
                                        nua_register(gateway_ptr->nh,
                                                                 NUTAG_URL(gateway_ptr->register_url),
+                                                                TAG_IF(gateway_ptr->register_sticky_proxy, NUTAG_PROXY(gateway_ptr->register_sticky_proxy)),
                                                                 SIPTAG_TO_STR(gateway_ptr->register_from),
                                                                 SIPTAG_FROM_STR(gateway_ptr->register_from),
                                                                 SIPTAG_CONTACT_STR(gateway_ptr->register_contact),