# Stale nonce and dropped registrations

**URL:** <https://community.asterisk.org/t/stale-nonce-and-dropped-registrations/30875>\
**Category:** Asterisk Support\
**Created:** [March 19, 2010, 3:08pm UTC](https://community.asterisk.org/t/stale-nonce-and-dropped-registrations/30875 "2010-03-19T15:08:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jstrope](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@jstrope](https://community.asterisk.org/u/jstrope)\
**Post date:** [March 19, 2010, 3:08pm UTC](https://community.asterisk.org/t/stale-nonce-and-dropped-registrations/30875/1 "2010-03-19T15:08:50Z")

</div>

I have about 20 Aastra 9480i phones connected to Asterisk 1.6.1.1. I’m regularly seeing messages like these in the logs:

Correct auth, but based on stale nonce received from ‘sip:134@172.27.7.6:5060’

Typically, this doesn’t seem to create any problems. However, these phones seem to lose their registration about once a day or so (they go into a “No Service” display on the phone and then, a minute or two later, reregister fine). I’m not sure if this is related or not to the “stale nonce” issue. I’m also seeing some Registration Unauthorized messages too while the phones themselves are registered (I’m assuming these are re-register requests?):

\<— SIP read from UDP://192.168.2.236:5060 —\>  
REGISTER sip:172.27.7.6:5060 SIP/2.0  
Via: SIP/2.0/UDP 192.168.2.236:5060;branch=z9hG4bK14b1f713f12371077.6cef217f54542d463  
Max-Forwards: 70  
From: sip:562@172.27.7.6:5060;tag=41771d98c5  
To: sip:562@172.27.7.6:5060  
Call-ID: 69b72ca629bd37fd  
CSeq: 27736 REGISTER  
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, OPTIONS, UPDATE, PRACK, SUBSCRIBE, INFO  
Allow-Events: talk, hold, conference, LocalModeStatus  
Contact: “Test User” sip:562@192.168.2.236:5060;transport=udp;+sip.instance="urn:uuid:00000000-0000-1000-8000-00085D21D8DA"  
Supported: gruu, path  
User-Agent: Aastra 9480i/2.5.3.18  
Content-Length: 0

\<-------------\>  
— (13 headers 0 lines) —  
Sending to 192.168.2.236 : 5060 (no NAT)

\<— Transmitting (NAT) to 192.168.2.236:5060 —\>  
SIP/2.0 401 Unauthorized  
Via: SIP/2.0/UDP 192.168.2.236:5060;branch=z9hG4bK14b1f713f12371077.6cef217f54542d463;received=192.168.2.236  
From: sip:562@172.27.7.6:5060;tag=41771d98c5  
To: sip:562@172.27.7.6:5060;tag=as3d32ce64  
Call-ID: 69b72ca629bd37fd  
CSeq: 27736 REGISTER  
Server: Asterisk PBX 1.6.1.6  
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO  
Supported: replaces, timer  
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="2e8f01d1"  
Content-Length: 0

\<------------\>  
Scheduling destruction of SIP dialog ‘69b72ca629bd37fd’ in 32000 ms (Method: REGISTER)  
social\*CLI\>  
\<— SIP read from UDP://192.168.2.236:5060 —\>  
REGISTER sip:172.27.7.6:5060 SIP/2.0  
Via: SIP/2.0/UDP 192.168.2.236:5060;branch=z9hG4bKcf3478ae611a82361.aff33c09e9fbc736e  
Max-Forwards: 70  
From: sip:562@172.27.7.6:5060;tag=41771d98c5  
To: sip:562@172.27.7.6:5060  
Call-ID: 69b72ca629bd37fd  
CSeq: 27737 REGISTER  
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, OPTIONS, UPDATE, PRACK, SUBSCRIBE, INFO  
Allow-Events: talk, hold, conference, LocalModeStatus  
Authorization: Digest username=“562”,realm=“asterisk”,nonce=“2e8f01d1”,uri=“sip:172.27.7.6:5060”,response=“6587b203b40a2a17b6fd1647bcae309d”,algorithm=MD5  
Contact: “Test User” sip:562@192.168.2.236:5060;transport=udp;+sip.instance="urn:uuid:00000000-0000-1000-8000-00085D21D8DA"  
Supported: gruu, path  
User-Agent: Aastra 9480i/2.5.3.18  
Content-Length: 0

\<-------------\>  
— (14 headers 0 lines) —  
Sending to 192.168.2.236 : 5060 (NAT)  
– Registered SIP ‘562’ at 192.168.2.236 port 5060  
Reliably Transmitting (NAT) to 192.168.2.236:5060:  
OPTIONS sip:562@192.168.2.236:5060;transport=udp SIP/2.0  
Via: SIP/2.0/UDP 172.27.7.6:5060;branch=z9hG4bK7a37964a;rport  
Max-Forwards: 70  
From: “asterisk” sip:asterisk@172.27.7.6;tag=as1f9468a4  
To: sip:562@192.168.2.236:5060;transport=udp  
Contact: sip:asterisk@172.27.7.6  
Call-ID: [4715f07b2a5a9d0927ea03c94e8bbec4@172.27.7.6](mailto:4715f07b2a5a9d0927ea03c94e8bbec4@172.27.7.6)  
CSeq: 102 OPTIONS  
User-Agent: Asterisk PBX 1.6.1.6  
Date: Fri, 19 Mar 2010 14:32:46 GMT  
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO  
Supported: replaces, timer  
Content-Length: 0

* * *

\<— Transmitting (NAT) to 192.168.2.236:5060 —\>  
SIP/2.0 200 OK  
Via: SIP/2.0/UDP 192.168.2.236:5060;branch=z9hG4bKcf3478ae611a82361.aff33c09e9fbc736e;received=192.168.2.236  
From: sip:562@172.27.7.6:5060;tag=41771d98c5  
To: sip:562@172.27.7.6:5060;tag=as3d32ce64  
Call-ID: 69b72ca629bd37fd  
CSeq: 27737 REGISTER  
Server: Asterisk PBX 1.6.1.6  
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO  
Supported: replaces, timer  
Expires: 120  
Contact: sip:562@192.168.2.236:5060;transport=udp;expires=120  
Date: Fri, 19 Mar 2010 14:32:46 GMT  
Content-Length: 0

\<------------\>  
Scheduling destruction of SIP dialog ‘69b72ca629bd37fd’ in 32000 ms (Method: REGISTER)  
social\*CLI\>  
\<— SIP read from UDP://192.168.2.236:5060 —\>  
SIP/2.0 200 OK  
Via: SIP/2.0/UDP 172.27.7.6:5060;branch=z9hG4bK7a37964a;rport=5060;received=172.27.7.6  
From: “asterisk” sip:asterisk@172.27.7.6;tag=as1f9468a4  
To: sip:562@192.168.2.236:5060;transport=udp;tag=835688800  
Call-ID: [4715f07b2a5a9d0927ea03c94e8bbec4@172.27.7.6](mailto:4715f07b2a5a9d0927ea03c94e8bbec4@172.27.7.6)  
CSeq: 102 OPTIONS  
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, OPTIONS, UPDATE, PRACK, SUBSCRIBE, INFO  
Server: Aastra 9480i/2.5.3.18  
Supported: gruu, timer, 100rel, replaces, path  
Content-Length: 0

\<-------------\>  
— (10 headers 0 lines) —  
[Mar 19 10:32:46] NOTICE[1826]: chan\_sip.c:16784 handle\_response\_peerpoke: Peer ‘562’ is now Reachable. (106ms / 2000ms)  
Really destroying SIP dialog ‘4715f07b2a5a9d0927ea03c94e8bbec4@172.27.7.6’ Method: OPTIONS

Reliably Transmitting (NAT) to 192.168.2.236:5060:  
OPTIONS sip:562@192.168.2.236:5060;transport=udp SIP/2.0  
Via: SIP/2.0/UDP 172.27.7.6:5060;branch=z9hG4bK48727a4f;rport  
Max-Forwards: 70  
From: “asterisk” sip:asterisk@172.27.7.6;tag=as736008c3  
To: sip:562@192.168.2.236:5060;transport=udp  
Contact: sip:asterisk@172.27.7.6  
Call-ID: [5a9e508f2617a133664e958f1ea5fc47@172.27.7.6](mailto:5a9e508f2617a133664e958f1ea5fc47@172.27.7.6)  
CSeq: 102 OPTIONS  
User-Agent: Asterisk PBX 1.6.1.6  
Date: Fri, 19 Mar 2010 14:33:46 GMT  
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO  
Supported: replaces, timer  
Content-Length: 0

\<— SIP read from UDP://192.168.2.236:5060 —\>  
SIP/2.0 200 OK  
Via: SIP/2.0/UDP 172.27.7.6:5060;branch=z9hG4bK48727a4f;rport=5060;received=172.27.7.6  
From: “asterisk” sip:asterisk@172.27.7.6;tag=as736008c3  
To: sip:562@192.168.2.236:5060;transport=udp;tag=2056812882  
Call-ID: [5a9e508f2617a133664e958f1ea5fc47@172.27.7.6](mailto:5a9e508f2617a133664e958f1ea5fc47@172.27.7.6)  
CSeq: 102 OPTIONS  
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, OPTIONS, UPDATE, PRACK, SUBSCRIBE, INFO  
Server: Aastra 9480i/2.5.3.18  
Supported: gruu, timer, 100rel, replaces, path  
Content-Length: 0

\<-------------\>  
— (10 headers 0 lines) —  
Really destroying SIP dialog ‘5a9e508f2617a133664e958f1ea5fc47@172.27.7.6’ Method: OPTIONS

Here is how the phones are configured in sip.conf:

[562]  
dtmfmode=rfc2833  
type=friend  
nat=yes  
canreinvite=no  
host=dynamic  
videosupport=yes  
qualify=yes  
maxcallbitrate=384  
context=localcontext

Also, on the Aastra phones, Registration Period is set to 0, Registration Failed Retry Timer is set to 1800, Registration Timeout Retry Timer is set to 120, and Registration Renewal Timer is set to 15 (defaults).

Anyone have any ideas on this?

---

<div class="post-metadata">

**Author:** ![indreias](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/indreias/32/507_2.png) [@indreias](https://community.asterisk.org/u/indreias)\
**Post date:** [March 19, 2010, 3:31pm UTC](https://community.asterisk.org/t/stale-nonce-and-dropped-registrations/30875/2 "2010-03-19T15:31:41Z")

</div>

Hello,

We had the same problem (No Service) for Aastra 57xi phones and we used the following workaround:

- Registration Period = 0 (in Aastra -\> Global SIP)
- qualify = no (in sip.conf for that extensions)

Is this working for you?

If no - have you the last firmware on the Aastra phones?

HTH,  
Ioan.

---

<div class="post-metadata">

**Author:** ![jstrope](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@jstrope](https://community.asterisk.org/u/jstrope)\
**Post date:** [March 19, 2010, 3:41pm UTC](https://community.asterisk.org/t/stale-nonce-and-dropped-registrations/30875/3 "2010-03-19T15:41:20Z")

</div>

The registration period value is what we have set. I’ll try qualify=no to see if it fixes the “No service” issue, but I know it doesn’t address the nonce issue or the Unauthorized login issue.
