Author: anthm Date: Fri Aug 1 14:18:35 2008 New Revision: 9219 Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c Log: make register-proxy preserve the url composed from proxy but target the packets to desired address MODENDP-121 Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h Fri Aug 1 14:18:35 2008 @@ -274,6 +274,7 @@ char *register_contact; char *register_to; char *register_proxy; + char *register_sticky_proxy; char *register_context; char *expires_str; char *register_url; Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Fri Aug 1 14:18:35 2008 @@ -886,8 +886,8 @@ 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 @@ 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; Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c Fri Aug 1 14:18:35 2008 @@ -150,6 +150,7 @@ 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),