--- chan_sip.c.cvs 2004-05-19 17:23:27.000000000 -0300 +++ chan_sip.c 2004-05-26 16:18:25.000000000 -0300 @@ -3760,10 +3761,13 @@ c++; } snprintf(a1, sizeof(a1), "%s:%s:%s", username, "asterisk", secret); + ast_log(LOG_WARNING, "A1='%s'\n",a1); if(strlen(resp_uri)) snprintf(a2, sizeof(a2), "%s:%s", method, resp_uri); else snprintf(a2, sizeof(a2), "%s:%s", method, uri); + ast_log(LOG_WARNING, "resp_uri='%s' uri='%s'\n", resp_uri, uri); + ast_log(LOG_WARNING, "A2='%s'\n",a2); if (strlen(md5secret)) snprintf(a1_hash, sizeof(a1_hash), "%s", md5secret); else @@ -3771,8 +3775,12 @@ md5_hash(a2_hash, a2); snprintf(resp, sizeof(resp), "%s:%s:%s", a1_hash, randdata, a2_hash); md5_hash(resp_hash, resp); - + ast_log(LOG_WARNING, "resp='%s' resp_hash='%s'\n", resp, resp_hash); /* resp_hash now has the expected response, compare the two */ + if(response) + ast_log(LOG_WARNING, "Client response='%s'\n", response); + else + ast_log(LOG_WARNING, "Client response not found\n"); if (response && !strncasecmp(response, resp_hash, strlen(resp_hash))) { /* Auth is OK */ @@ -3850,6 +3858,7 @@ } else { p->nat = peer->nat; transmit_response(p, "100 Trying", req); + ast_log(LOG_NOTICE, "Checking Auth: randata=%s name=%s secret=%s uri=%s\n",p->randdata, peer->name, peer->secret, uri); if (!(res = check_auth(p, req, p->randdata, sizeof(p->randdata), peer->name, peer->secret, peer->md5secret, "REGISTER", uri, 0, ignore))) { sip_cancel_destroy(p); if (parse_contact(p, peer, req)) {