summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorAlexander Traud <pabstraud@compuserve.com>2017-07-03 17:59:43 +0200
committerAlexander Traud <pabstraud@compuserve.com>2017-07-03 11:01:59 -0500
commit43f636f6e50a01a788a57c903be299c3b4bdb0c1 (patch)
treeefbea4d5563d482384fb0a176fc1b9d18b061e70 /channels/chan_sip.c
parent6e48c4c8e1bb9725efa44bbfc578d6c9d7409436 (diff)
chan_sip: Only when different, add TCP|TLS in autodomain (SIP Domain Support).
When sip.conf contained tcpenable=yes and autodomain=yes, the TCP domain was added in any case, because of a local Boolean-negation error of the return value of ast_sockaddr_cmp. After fixing this error for TCP and TLS, the TLS domain was still always added with tlsenable=yes, because the domains were not compared just on the address but also on the port – and TLS is always on a different port than UDP/TCP. ASTERISK-27106 Change-Id: I14fe9e319e238320b094016980445ef3a5b3337c
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 5affee6eb..cd2f2aebf 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -33279,15 +33279,15 @@ static int reload_config(enum channelreloadreason reason)
/* If TCP is running on a different IP than UDP, then add it too */
if (!ast_sockaddr_isnull(&sip_tcp_desc.local_address) &&
- !ast_sockaddr_cmp(&bindaddr, &sip_tcp_desc.local_address)) {
+ ast_sockaddr_cmp_addr(&bindaddr, &sip_tcp_desc.local_address)) {
add_sip_domain(ast_sockaddr_stringify_addr(&sip_tcp_desc.local_address),
SIP_DOMAIN_AUTO, NULL);
}
/* If TLS is running on a different IP than UDP and TCP, then add that too */
if (!ast_sockaddr_isnull(&sip_tls_desc.local_address) &&
- !ast_sockaddr_cmp(&bindaddr, &sip_tls_desc.local_address) &&
- !ast_sockaddr_cmp(&sip_tcp_desc.local_address,
+ ast_sockaddr_cmp_addr(&bindaddr, &sip_tls_desc.local_address) &&
+ ast_sockaddr_cmp_addr(&sip_tcp_desc.local_address,
&sip_tls_desc.local_address)) {
add_sip_domain(ast_sockaddr_stringify_addr(&sip_tcp_desc.local_address),
SIP_DOMAIN_AUTO, NULL);