<p>Alexander Traud has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/5956">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_sip: Only when different, add TCP|TLS in autodomain (SIP Domain Support).<br><br>When sip.conf contained tcpenable=yes and autodomain=yes, the TCP domain was<br>added in any case, because of a local Boolean-negation error of the return value<br>of ast_sockaddr_cmp. After fixing this error for TCP and TLS, the TLS domain was<br>still always added with tlsenable=yes, because the domains were not compared<br>just on the address but also on the port – and TLS is always on a different port<br>than UDP/TCP.<br><br>ASTERISK-27106<br><br>Change-Id: I14fe9e319e238320b094016980445ef3a5b3337c<br>---<br>M channels/chan_sip.c<br>1 file changed, 3 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/56/5956/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/channels/chan_sip.c b/channels/chan_sip.c<br>index 1994103..f24b74e 100644<br>--- a/channels/chan_sip.c<br>+++ b/channels/chan_sip.c<br>@@ -33171,15 +33171,15 @@<br> <br>              /* If TCP is running on a different IP than UDP, then add it too */<br>           if (!ast_sockaddr_isnull(&sip_tcp_desc.local_address) &&<br>-             !ast_sockaddr_cmp(&bindaddr, &sip_tcp_desc.local_address)) {<br>+                 ast_sockaddr_cmp_addr(&bindaddr, &sip_tcp_desc.local_address)) {<br>                  add_sip_domain(ast_sockaddr_stringify_addr(&sip_tcp_desc.local_address),<br>                                 SIP_DOMAIN_AUTO, NULL);<br>                }<br> <br>          /* If TLS is running on a different IP than UDP and TCP, then add that too */<br>                 if (!ast_sockaddr_isnull(&sip_tls_desc.local_address) &&<br>-             !ast_sockaddr_cmp(&bindaddr, &sip_tls_desc.local_address) &&<br>-                 !ast_sockaddr_cmp(&sip_tcp_desc.local_address,<br>+                   ast_sockaddr_cmp_addr(&bindaddr, &sip_tls_desc.local_address) &&<br>+             ast_sockaddr_cmp_addr(&sip_tcp_desc.local_address,<br>                                  &sip_tls_desc.local_address)) {<br>                     add_sip_domain(ast_sockaddr_stringify_addr(&sip_tcp_desc.local_address),<br>                                 SIP_DOMAIN_AUTO, NULL);<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/5956">change 5956</a>. To unsubscribe, 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/5956"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I14fe9e319e238320b094016980445ef3a5b3337c </div>
<div style="display:none"> Gerrit-Change-Number: 5956 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>