Author: mjordan Date: Thu Aug 21 12:34:43 2014 New Revision: 421720 URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=421720 Log: chan_sip: Don't use port derived from fromdomain if it isn't set
If a user does not provide a port in the fromdomain setting, chan_sip will set the fromdomainport to STANDARD_SIP_PORT (5060). The fromdomainport value will then get used unilaterally in certain places. This causes issues with TLS, where the default port is expected to be 5061. This patch modifies chan_sip such that fromdomainport is only used if it is not the standard SIP port; otherwise, the port from the SIP pvt's recorded self IP address is used. Review: https://reviewboard.asterisk.org/r/3893/ ASTERISK-24178 #close Reported by: Elazar Broad patches: fromdomainport_fix.diff uploaded by Elazar Broad (License 5835) ........ Merged revisions 421717 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 421718 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 421719 from http://svn.asterisk.org/svn/asterisk/branches/12 Modified: branches/13/ (props changed) branches/13/channels/chan_sip.c Propchange: branches/13/ ------------------------------------------------------------------------------ Binary property 'branch-12-merged' - no diff available. Modified: branches/13/channels/chan_sip.c URL: http://svnview.digium.com/svn/asterisk/branches/13/channels/chan_sip.c?view=diff&rev=421720&r1=421719&r2=421720 ============================================================================== --- branches/13/channels/chan_sip.c (original) +++ branches/13/channels/chan_sip.c Thu Aug 21 12:34:43 2014 @@ -13954,7 +13954,7 @@ ast_uri_encode(l, tmp_l, sizeof(tmp_l), ast_uri_sip_user); } - ourport = (p->fromdomainport) ? p->fromdomainport : ast_sockaddr_port(&p->ourip); + ourport = (p->fromdomainport && (p->fromdomainport != STANDARD_SIP_PORT)) ? p->fromdomainport : ast_sockaddr_port(&p->ourip); /* If a caller id name was specified, add a display name. */ if (cid_has_name || !cid_has_num) { @@ -14920,7 +14920,7 @@ { struct sip_request req; struct ast_str *out = ast_str_alloca(500); - int ourport = (p->fromdomainport) ? p->fromdomainport : ast_sockaddr_port(&p->ourip); + int ourport = (p->fromdomainport && (p->fromdomainport != STANDARD_SIP_PORT)) ? p->fromdomainport : ast_sockaddr_port(&p->ourip); const char *domain; const char *exten = S_OR(vmexten, default_vmexten); -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- svn-commits mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/svn-commits