registration not authorized – stale nonce

Home » Asterisk Users » registration not authorized – stale nonce
Asterisk Users No Comments

Asterisk destroys SIP dialogs in 32 secs, so increased the UAC registry expiration to 300 secs just in case, but that didn’t help either.

Date: Sun, 1 Jan 2012 18:13:07 -0500
Subject: [asterisk-users] registration not authorized – stale nonce

I have a very basic setup where a UAC registers with Asterisk – both on the same subnet, no nat.

The following is the flow of messages:
1. UAC sends the registration request
2. Asterisk responds with 401 Unauthorized with a new nonce
3. UAC sends a new digest with the nonce received from Asterisk
4. Asterisk authorizes UAC and sends OK

This works as expected when there is no load on the Asterisk server.

For testing asterisk under load, I use Sipp (runnig at a server on the same subnet) with a very basic scenario (call is placed, moh played, sipp hangs up after 20 secs). Max calls on the system at one time is 50.

My problem happens when the above UAC tries to register while the Sipp test is running.

Steps 1 and 2 above happen as expected, Asterisk sends a new nonce to the UAC, but at step 3, UAC sends the old digest (old nonce) back to Asterisk. Asterisk doesn’t authorize the UAC with “Correct auth, but based on stale nonce” warning.

UAC registration expiry is 60 seconds. As I mentioned, if the test is not running, everything seems to be OK. If I adjust the max calls to 10 in the test and reduce the load, the registrations go thru.

Any ideas?