--- chan_sip.c.orig 2009-03-19 10:10:13.000000000 +0100 +++ chan_sip.c 2009-03-19 13:09:28.000000000 +0100 @@ -6524,11 +6524,6 @@ expire = strchr(buf, '~'); if (expire) *expire++ = '\0'; - callback = strchr(buf, '/'); - if (callback) - *callback++ = '\0'; - if (ast_strlen_zero(callback)) - callback = "s"; sip_parse_host(buf, lineno, &username, &portnum, &transport); @@ -6536,6 +6531,11 @@ hostname = strrchr(username, '@'); /* allow @ in the first part */ if (hostname) *hostname++ = '\0'; + callback = strchr(hostname, '/'); + if (callback) + *callback++ = '\0'; + if (ast_strlen_zero(callback)) + callback = "s"; if (ast_strlen_zero(username) || ast_strlen_zero(hostname)) { ast_log(LOG_WARNING, "Format for registration is [transport://]user[:secret[:authuser]]@domain[:port][/extension][~expiry] at line %d\n", lineno); return -1;