aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-02 17:27:36 +0000
committerbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-02 17:27:36 +0000
commit64730d55252937e9f05dfc4e6686f5095f95acf6 (patch)
tree2a459dbaf5ae8926568e0fa3ec768fe28b2d3c10 /channels
parentd470c1559eb7f4366f5bccc1d2de72fde28bd6ff (diff)
Fix to sip_parse_host so that it passes the correct information to sip_registry.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@127434 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 74b20dd64..17b1dfa0f 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)) {