From: Joshua Colp Date: Tue, 29 Jan 2008 15:30:19 +0000 (+0000) Subject: Make externip work as documented. If no port is specified it will use the value of... X-Git-Tag: 1.6.0-beta3~2^2~152 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d38298c27269aa64300897a58e1adf1a1bfa0391;p=thirdparty%2Fasterisk.git Make externip work as documented. If no port is specified it will use the value of bindport instead of always being 5060. (closes issue #11858) Reported by: hmodes git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@100833 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 9f2cc3d83f..919dd358ba 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -19895,7 +19895,6 @@ static int reload_config(enum channelreloadreason reason) ourport_tcp = STANDARD_SIP_PORT; ourport_tls = STANDARD_TLS_PORT; bindaddr.sin_port = htons(STANDARD_SIP_PORT); - externip.sin_port = htons(STANDARD_SIP_PORT); global_srvlookup = DEFAULT_SRVLOOKUP; global_tos_sip = DEFAULT_TOS_SIP; global_tos_audio = DEFAULT_TOS_AUDIO; @@ -20192,6 +20191,9 @@ static int reload_config(enum channelreloadreason reason) if (ast_parse_arg(v->value, PARSE_INADDR, &externip)) ast_log(LOG_WARNING, "Invalid address for externip keyword: %s\n", v->value); externexpire = 0; + /* If no port was specified use the value of bindport */ + if (!externip.sin_port) + externip.sin_port = bindaddr.sin_port; } else if (!strcasecmp(v->name, "externhost")) { ast_copy_string(externhost, v->value, sizeof(externhost)); if (ast_parse_arg(externhost, PARSE_INADDR, &externip))