[Home]

Summary:ASTERISK-23612: sip registration expiry is not updated on shutdown
Reporter:klaus3000 (klaus3000)Labels:
Date Opened:2014-04-10 04:46:34Date Closed:2014-04-10 07:16:48
Priority:MinorRegression?
Status:Closed/CompleteComponents:Channels/chan_sip/Registration
Versions:11.8.1 Frequency of
Occurrence
Related
Issues:
Environment:Standard sip.conf, no realtime.Attachments:
Description:When Asterisk is shutdown, the registration expiration does not ge updated, eg:

sip show peer u+437203102510212
..
 Expire       : 124


sip show peer u+437203102510212
..
 Expire       : 102


core restart now
sip show peer u+437203102510212
 Expire       : 125

It seems that the registration in asdb only gets updated on REGISTER or on expiration, but not on shutdown. I think the problem is related how Asterisk stores the registration in astbd:

sqlite> select * from astdb;
/SIP/Registry/u+437203102510212|83.136.33.25:45228:120:u+437203102510212:sip:u+437203102510212@192.168.0.7:45228;rinstance=5f057e1ec5c005e4

Asterisk stores the registration expiry in seconds - without any absolute anchor. I think a quick fix would be to not only store the expiration value, but also the timestamp of the last update in the astdb. Then, on Asterisk reload, Asterisk can calculate if the registration is meanwhile expired and ignore it.

I know there are pros and cons of the current behavior. For example if the clients still use the same source address, the client is immediately available when Asterisk is started again after some downtime. On the other hand, it is sending lots of OPTIONS requests to clients which are already gone (or have a new source IP address).

Comments:By: Matt Jordan (mjordan) 2014-04-10 07:16:48.434-0500

Closing as a duplicate of ASTERISK-23611