From 096d899b711c462e70a4081df282d2ceb60db531 Mon Sep 17 00:00:00 2001 From: Brett Bryant Date: Tue, 8 Jul 2008 14:42:03 +0000 Subject: [PATCH] Merged revisions 127434 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r127434 | bbryant | 2008-07-02 12:27:36 -0500 (Wed, 02 Jul 2008) | 1 line Fix to sip_parse_host so that it passes the correct information to sip_registry. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@129041 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 3cb18ff0ac..c0d8ffe49a 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -6056,7 +6056,7 @@ static int sip_register(const char *value, int lineno) if (hostname) *hostname++ = '\0'; if (ast_strlen_zero(username) || ast_strlen_zero(hostname)) { - ast_log(LOG_WARNING, "Format for registration is user[:secret[:authuser]]@host[:port][/contact] at line %d\n", lineno); + ast_log(LOG_WARNING, "Format for registration is [transport://]user[:secret[:authuser]]@host[:port][/contact][~expiry] at line %d\n", lineno); return -1; } /* split user[:secret[:authuser]] */ @@ -18367,7 +18367,12 @@ static int sip_parse_host(char *line, int lineno, char **hostname, int *portnum, *transport = SIP_TRANSPORT_UDP; } - if ((port = strchr(*hostname, ':'))) { + if ((line = strrchr(*hostname, '@'))) + line++; + else + line = *hostname; + + if ((port = strrchr(line, ':'))) { *port++ = '\0'; if (!sscanf(port, "%u", portnum)) {