aboutsummaryrefslogtreecommitdiffstats
path: root/channels/sip/config_parser.c
diff options
context:
space:
mode:
authorsimon.perreault <simon.perreault@f38db490-d61c-443f-a65b-d21fe96a405b>2010-08-11 13:31:39 +0000
committersimon.perreault <simon.perreault@f38db490-d61c-443f-a65b-d21fe96a405b>2010-08-11 13:31:39 +0000
commit2b70d4917f1c6e778f9700eb801a538bc28def3a (patch)
treeb1144a9f6218f2cb460171b101f58022c3a6742a /channels/sip/config_parser.c
parent92f6466eff47e38a66e65540f12f6dc77bda2a3e (diff)
Merged revisions 281687 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r281687 | simon.perreault | 2010-08-11 09:30:59 -0400 (Wed, 11 Aug 2010) | 9 lines Fix parsing of IPv6 address literals in outboundproxy (closes issue #17757) Reported by: oej Patches: 17757.diff uploaded by sperreault (license 252) sip.conf.diff uploaded by sperreault (license 252) Tested by: oej ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@281688 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/sip/config_parser.c')
-rw-r--r--channels/sip/config_parser.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/channels/sip/config_parser.c b/channels/sip/config_parser.c
index 659e8cecc..0ab9ed769 100644
--- a/channels/sip/config_parser.c
+++ b/channels/sip/config_parser.c
@@ -661,16 +661,18 @@ int sip_parse_host(char *line, int lineno, char **hostname, int *portnum, enum s
else
line = *hostname;
- if ((port = strrchr(line, ':'))) {
- *port++ = '\0';
+ if (ast_sockaddr_split_hostport(line, hostname, &port, 0) == 0) {
+ ast_log(LOG_WARNING, "Cannot parse host '%s' on line %d of sip.conf.\n",
+ line, lineno);
+ return -1;
+ }
+ if (port) {
if (!sscanf(port, "%5u", portnum)) {
ast_log(LOG_NOTICE, "'%s' is not a valid port number on line %d of sip.conf. using default.\n", port, lineno);
port = NULL;
}
- }
-
- if (!port) {
+ } else {
if (*transport & SIP_TRANSPORT_TLS) {
*portnum = STANDARD_TLS_PORT;
} else {