aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-04 22:42:34 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-04 22:42:34 +0000
commit3dbe39533d1683f751854d46ad50d2c8ad63ba88 (patch)
tree93bd1ab983c560749a4bf1c4f6a7503a246919f0 /channels/chan_sip.c
parente9f2397173028076b028bc9043dc78a68be350f0 (diff)
generate fewer 'stale nonce' messages (issue #5381)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6718 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rwxr-xr-xchannels/chan_sip.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 4895a1786..5505a846f 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -6177,14 +6177,17 @@ static int check_auth(struct sip_pvt *p, struct sip_request *req, char *randdata
ast_md5_hash(resp_hash, resp);
if (wrongnonce) {
- ast_log(LOG_NOTICE, "stale nonce received from '%s'\n", get_header(req, "To"));
snprintf(randdata, randlen, "%08x", rand());
if (ua_hash && !strncasecmp(ua_hash, resp_hash, strlen(resp_hash))) {
+ if (sipdebug)
+ ast_log(LOG_NOTICE, "stale nonce received from '%s'\n", get_header(req, "To"));
/* We got working auth token, based on stale nonce . */
transmit_response_with_auth(p, response, req, randdata, reliable, respheader, 1);
} else {
- /* Everything was wrong, so give the device one more try */
+ /* Everything was wrong, so give the device one more try with a new challenge */
+ if (sipdebug)
+ ast_log(LOG_NOTICE, "Bad authentication received from '%s'\n", get_header(req, "To"));
transmit_response_with_auth(p, response, req, randdata, reliable, respheader, 0);
}