From ec6e4d2f60cde68bacb5edada6cb749275a73719 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Tue, 16 Dec 2008 15:44:28 +0000 Subject: [PATCH] When using externhost make sure the port gets set to the bindaddr port if one was not specified in the externhost value itself. (closes issue #13634) Reported by: performer git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164659 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 834472e7c5..de7378fa01 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -22849,6 +22849,9 @@ static int reload_config(enum channelreloadreason reason) if (ast_parse_arg(externhost, PARSE_INADDR, &externip)) ast_log(LOG_WARNING, "Invalid address for externhost keyword: %s\n", externhost); externexpire = time(NULL); + /* 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, "externrefresh")) { if (sscanf(v->value, "%d", &externrefresh) != 1) { ast_log(LOG_WARNING, "Invalid externrefresh value '%s', must be an integer >0 at line %d\n", v->value, v->lineno);