From: Michael Jerris Date: Fri, 2 Mar 2007 01:44:36 +0000 (+0000) Subject: when using ext-sip-ip, bind to the internal address, but still have the external... X-Git-Tag: v1.0-beta1~987 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b43057b2941b41c538bd5f3d028dd92490f5fa9;p=thirdparty%2Ffreeswitch.git when using ext-sip-ip, bind to the internal address, but still have the external address in the contact and via headers. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4422 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 8b75329bc7..ac253fa210 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -5074,7 +5074,6 @@ static switch_status_t config_sofia(int reload) switch_status_t status = SWITCH_STATUS_SUCCESS; sofia_profile_t *profile = NULL; char url[512] = ""; - char bindurl[512] =""; switch_mutex_lock(globals.mutex); globals.running = 1; switch_mutex_unlock(globals.mutex); @@ -5272,13 +5271,10 @@ static switch_status_t config_sofia(int reload) profile->sipdomain = switch_core_strdup(profile->pool, profile->sipip); } if (profile->extsipip) { - snprintf(url, sizeof(url), "sip:mod_sofia@%s:%d", profile->extsipip, profile->sip_port); - snprintf(bindurl, sizeof(url), "sip:mod_sofia@%s:%d", profile->sipip, profile->sip_port); - profile->url = switch_core_strdup(profile->pool, url); - profile->bindurl = switch_core_strdup(profile->pool, bindurl); + profile->url = switch_core_sprintf(profile->pool, "sip:mod_sofia@%s:%d", profile->extsipip, profile->sip_port); + profile->bindurl = switch_core_sprintf(profile->pool, "%s;maddr=%s", profile->url, profile->sipip); } else { - snprintf(url, sizeof(url), "sip:mod_sofia@%s:%d", profile->sipip, profile->sip_port); - profile->url = switch_core_strdup(profile->pool, url); + profile->url = switch_core_sprintf(profile->pool, "sip:mod_sofia@%s:%d", profile->sipip, profile->sip_port); profile->bindurl = profile->url; } }