<p>George Joseph <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14275">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_sip: externhost/externaddr with non-default TCP/TLS ports.<br><br>ASTERISK-28372<br>Reported by: Anton Satskiy<br><br>ASTERISK-24428<br>Reported by: sstream<br><br>Change-Id: I2b7432a9bf3b09dc8515297ff955636db7a6224c<br>---<br>M channels/chan_sip.c<br>1 file changed, 15 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/chan_sip.c b/channels/chan_sip.c</span><br><span>index 9bc282b..afc555d 100644</span><br><span>--- a/channels/chan_sip.c</span><br><span>+++ b/channels/chan_sip.c</span><br><span>@@ -3914,9 +3914,21 @@</span><br><span> /* for consistency, default to the externaddr port */</span><br><span> externtcpport = ast_sockaddr_port(&externaddr);</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!externtcpport) {</span><br><span style="color: hsl(120, 100%, 40%);">+ externtcpport = ast_sockaddr_port(&sip_tcp_desc.local_address);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!externtcpport) {</span><br><span style="color: hsl(120, 100%, 40%);">+ externtcpport = STANDARD_SIP_PORT;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> ast_sockaddr_set_port(us, externtcpport);</span><br><span> break;</span><br><span> case AST_TRANSPORT_TLS:</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!externtlsport) {</span><br><span style="color: hsl(120, 100%, 40%);">+ externtlsport = ast_sockaddr_port(&sip_tls_desc.local_address);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!externtlsport) {</span><br><span style="color: hsl(120, 100%, 40%);">+ externtlsport = STANDARD_TLS_PORT;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> ast_sockaddr_set_port(us, externtlsport);</span><br><span> break;</span><br><span> case AST_TRANSPORT_UDP:</span><br><span>@@ -32652,8 +32664,8 @@</span><br><span> default_primary_transport = AST_TRANSPORT_UDP;</span><br><span> ourport_tcp = STANDARD_SIP_PORT;</span><br><span> ourport_tls = STANDARD_TLS_PORT;</span><br><span style="color: hsl(0, 100%, 40%);">- externtcpport = STANDARD_SIP_PORT;</span><br><span style="color: hsl(0, 100%, 40%);">- externtlsport = STANDARD_TLS_PORT;</span><br><span style="color: hsl(120, 100%, 40%);">+ externtcpport = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ externtlsport = 0;</span><br><span> sip_cfg.srvlookup = DEFAULT_SRVLOOKUP;</span><br><span> global_tos_sip = DEFAULT_TOS_SIP;</span><br><span> global_tos_audio = DEFAULT_TOS_AUDIO;</span><br><span>@@ -33144,10 +33156,9 @@</span><br><span> } else if (!strcasecmp(v->name, "externtcpport")) {</span><br><span> if (!(externtcpport = port_str2int(v->value, 0))) {</span><br><span> ast_log(LOG_WARNING, "Invalid externtcpport value, must be a positive integer between 1 and 65535 at line %d\n", v->lineno);</span><br><span style="color: hsl(0, 100%, 40%);">- externtcpport = 0;</span><br><span> }</span><br><span> } else if (!strcasecmp(v->name, "externtlsport")) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (!(externtlsport = port_str2int(v->value, STANDARD_TLS_PORT))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!(externtlsport = port_str2int(v->value, 0))) {</span><br><span> ast_log(LOG_WARNING, "Invalid externtlsport value, must be a positive integer between 1 and 65535 at line %d\n", v->lineno);</span><br><span> }</span><br><span> } else if (!strcasecmp(v->name, "allow")) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14275">change 14275</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/14275"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I2b7432a9bf3b09dc8515297ff955636db7a6224c </div>
<div style="display:none"> Gerrit-Change-Number: 14275 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>