Summary: | ASTERISK-23611: SIP registration remaining expiry time is not updated on shutdown | ||
Reporter: | klaus3000 (klaus3000) | Labels: | |
Date Opened: | 2014-04-10 04:45:46 | Date Closed: | |
Priority: | Minor | Regression? | |
Status: | Open/New | Components: | Channels/chan_sip/Registration |
Versions: | 11.8.1 13.18.4 | 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-17 16:37:12.221-0500 I think it'd be interesting to have an option in {{chan_sip}} and {{chan_pjsip}} that kept track of the timers. Would you be interested in writing such a patch? |