diff -Nurp -x .svn a/channels/chan_sip.c b/channels/chan_sip.c --- a/channels/chan_sip.c 2009-09-23 21:02:15.506767848 -0400 +++ b/channels/chan_sip.c 2009-09-23 21:04:47.544828383 -0400 @@ -23947,13 +23947,12 @@ static struct sip_auth *add_realm_authen } stringp = username; username = strsep(&stringp, ":"); - if (username) { - secret = strsep(&stringp, ":"); + secret = stringp; if (!secret) { stringp = username; - md5secret = strsep(&stringp, "#"); + username = strsep(&stringp, "#"); + md5secret = stringp; } - } if (!(auth = ast_calloc(1, sizeof(*auth)))) return authlist;