Sip reload seems to be losing registrations from phones

We have Asterisk 13.11.2 compiled on Ubuntu 16.04.1 (clean install). Previously we were running Asterisk 12.2. The contents of /etc/asterisk was copied across from Asterisk 12.2.

When we were running 12.2 we could do a ‘sip reload’ without any issues.

Since upgrading to 13.11.2 existing registered phones seem to lose their registration when we run ‘sip reload’ and when I run ‘core set verbose 9’ soon afterwards I can see all the phones re-registering over the next few minutes.

An ‘authentication failed’ warning is shown in the Asterisk log when phones attempt to make a call prior to re-registering.

We use Cisco SPA504g and Gigaset A510IP phones

Bug:
https://reviewboard.asterisk.org/r/2171/

Are you placing everything in sip.conf? Not using realtime? What is the console output when you do the reload, and the result of sip show peers?

Thanks, but that bug was submitted 4 years ago - I would guess this was fixed long before 13.11.2?

Everything is in sip.conf and not using realtime or anything special as far as I know.

The log shows the following after ‘sip reload’:

[Nov 10 08:15:55] VERBOSE[10778][C-000004a7] app_dial.c: SIP/601-00000fb6 is ringing
[Nov 10 08:15:55] VERBOSE[10778][C-000004a7] app_dial.c: SIP/625-00000fb7 is ringing
[Nov 10 08:16:05] VERBOSE[1237] asterisk.c: Remote UNIX connection
[Nov 10 08:16:08] VERBOSE[1484] chan_sip.c: Reloading SIP
[Nov 10 08:16:08] VERBOSE[1484] config.c: Parsing ‘/etc/asterisk/sip.conf’: Found
[Nov 10 08:16:08] VERBOSE[1484] config.c: Parsing ‘/etc/asterisk/users.conf’: Found
[Nov 10 08:16:08] VERBOSE[1484] netsock2.c: Using SIP CoS mark 4
[Nov 10 08:16:08] VERBOSE[1484] config.c: Parsing ‘/etc/asterisk/sip_notify.conf’: Found
[Nov 10 08:16:08] VERBOSE[10778][C-000004a7] app_dial.c: Nobody picked up in 13000 ms
[Nov 10 08:16:08] VERBOSE[1283] chan_sip.c: Extension Changed 601[localext-nz] new state Idle for Notify User 606

Interestingly it appears to only be affecting around 10% of our phones based on the number we see re-registering after ‘sip reload’’. This is what I get when grepping the log file for “Registered SIP”. When I run ‘sip show peers’ after the ‘sip reload’ I remember that things looked generally ok, although I can’t be sure of that (don’t want to run it again during business hours at this stage).

[Nov 10 08:16:31] VERBOSE[1484] chan_sip.c: Registered SIP ‘704’ at 192.168.6.131:5060
[Nov 10 08:17:05] VERBOSE[1484] chan_sip.c: Registered SIP ‘702’ at 192.168.6.137:5060
[Nov 10 08:17:07] VERBOSE[1484] chan_sip.c: Registered SIP ‘703’ at 192.168.6.138:5060
[Nov 10 08:17:47] VERBOSE[1484] chan_sip.c: Registered SIP ‘710’ at 192.168.6.143:5060
[Nov 10 08:21:40] VERBOSE[1484] chan_sip.c: Registered SIP ‘856’ at 192.168.2.11:5060
[Nov 10 08:30:27] VERBOSE[1484] chan_sip.c: Registered SIP ‘675’ at 192.168.6.133:5060
[Nov 10 08:30:31] VERBOSE[1484] chan_sip.c: Registered SIP ‘681’ at 192.168.6.127:5060
[Nov 10 08:30:33] VERBOSE[1484] chan_sip.c: Registered SIP ‘683’ at 192.168.6.126:5060
[Nov 10 08:30:38] VERBOSE[1484] chan_sip.c: Registered SIP ‘679’ at 192.168.6.132:5060

And here is the result when grepping the log for “Failed to authenticate” after the SIP reload. This users phone came right after re-registering a few minutes later.

[Nov 10 08:18:26] NOTICE[1484][C-000004ad] chan_sip.c: Failed to authenticate device “FRED FLINSTONE” sip:681@companyname.com;tag=b82407348a8b6066o0
[Nov 10 08:18:34] NOTICE[1484][C-000004ae] chan_sip.c: Failed to authenticate device “FRED FLINSTONE” sip:681@companyname.com;tag=942eee3dc52dffbao0
[Nov 10 08:18:43] NOTICE[1484][C-000004b0] chan_sip.c: Failed to authenticate device “FRED FLINSTONE” sip:681@companyname.com;tag=ec43ee57238a721ao0
[Nov 10 08:18:48] NOTICE[1484][C-000004b1] chan_sip.c: Failed to authenticate device “FRED FLINSTONE” sip:681@companyname.com;tag=5d8cae84fa0269d6o0
[Nov 10 08:18:58] NOTICE[1484][C-000004b3] chan_sip.c: Failed to authenticate device “FRED FLINSTONE” sip:681@companyname.com;tag=a37f47516f59634ao0
[Nov 10 08:19:04] NOTICE[1484][C-000004b4] chan_sip.c: Failed to authenticate device “FRED FLINSTONE” sip:681@companyname.com;tag=bd4954e5e602950ao0
[Nov 10 08:19:11] NOTICE[1484][C-000004b7] chan_sip.c: Failed to authenticate device “FRED FLINSTONE” sip:681@companyname.com;tag=892a96e3596b0deao0
[Nov 10 08:21:01] NOTICE[1484][C-000004bc] chan_sip.c: Failed to authenticate device “FRED FLINSTONE” sip:681@companyname.com;tag=14fd9fe79eba2392o0
[Nov 10 08:21:06] NOTICE[1484][C-000004bd] chan_sip.c: Failed to authenticate device “FRED FLINSTONE” sip:681@companyname.com;tag=9a728251b907965ao0