From: Brian West Date: Thu, 12 Nov 2009 15:25:13 +0000 (+0000) Subject: missing port X-Git-Tag: v1.0.6~1424 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffb0fa5551f9c2ebcc4220dd01fc6d75ea6a4833;p=thirdparty%2Ffreeswitch.git missing port git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15448 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/endpoints/mod_sofia/sofia_sla.c b/src/mod/endpoints/mod_sofia/sofia_sla.c index 1fee96437b..bbd7e85439 100644 --- a/src/mod/endpoints/mod_sofia/sofia_sla.c +++ b/src/mod/endpoints/mod_sofia/sofia_sla.c @@ -154,6 +154,8 @@ void sofia_sla_handle_sip_i_subscribe(nua_t *nua, const char *contact_str, sofia char *sla_contact = NULL; char network_ip[80]; int network_port = 0; + char port_str[25] = ""; + sofia_transport_t transport = sofia_glue_url2transport(sip->sip_contact->m_url); sofia_glue_get_addr(nua_current_request(nua), network_ip, sizeof(network_ip), &network_port); @@ -217,10 +219,15 @@ void sofia_sla_handle_sip_i_subscribe(nua_t *nua, const char *contact_str, sofia *p++ = '\0'; } } + + switch_snprintf(port_str, sizeof(port_str), ":%ld", sofia_glue_transport_has_tls(transport) ? profile->tls_sip_port : profile->sip_port); + if (sofia_glue_check_nat(profile, network_ip)) { - sla_contact = switch_mprintf("", profile->sla_contact, profile->extsipip, sofia_glue_transport2str(transport)); + sla_contact = switch_mprintf("", profile->sla_contact, profile->extsipip, + port_str, sofia_glue_transport2str(transport)); } else { - sla_contact = switch_mprintf("", profile->sla_contact, profile->sipip, sofia_glue_transport2str(transport)); + sla_contact = switch_mprintf("", profile->sla_contact, profile->sipip, + port_str, sofia_glue_transport2str(transport)); } nua_respond(nh, SIP_202_ACCEPTED, SIPTAG_CONTACT_STR(sla_contact), NUTAG_WITH_THIS(nua),