From: Brett Bryant Date: Wed, 2 Jul 2008 17:27:36 +0000 (+0000) Subject: Fix to sip_parse_host so that it passes the correct information to sip_registry. X-Git-Tag: 1.6.2.0-beta1~1811 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b30ed551e053ada85518b479bc0cc75a386403f0;p=thirdparty%2Fasterisk.git Fix to sip_parse_host so that it passes the correct information to sip_registry. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127434 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 74b20dd64e..17b1dfa0ff 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -6379,7 +6379,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][~expiry] 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]] */ @@ -19693,7 +19693,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)) {