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]] */
*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)) {