3
votes

I have a res_mysql.conf configured to use some database db which is refilled from db.sql file. After loading the dump I reload configurations and my SIP peers disappear:

dev-ast*CLI> sip show peers
Name/username              Host                                    Dyn Forcerport ACL Port     Status     Realtime
0 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 0 offline]

After a while, they register again:

dev-ast*CLI> sip show peers
Name/username              Host                                    Dyn Forcerport ACL Port     Status     Realtime
S0ea8c0d/S0ea8c0d          192.168.242.235                          D                 5060     OK (12 ms) Cached RT
S7af152e/S7af152e          192.168.241.147                          D                 5060     OK (14 ms) Cached RT
Se865486/Se865486          192.168.241.132                          D                 5060     OK (14 ms) Cached RT
3 sip peers [Monitored: 3 online, 0 offline Unmonitored: 0 online, 0 offline]

I noticed that if I wait for a minute or two after loading the dump I can reload configurations safely, without losing my peers.

Any ideas?

2

2 Answers

3
votes

Looks like you have peers in realtime.

Asterisk by default use

rtcachefriends=yes

After dump/restore very likly peers have older update time.

So, when you do sip reload it clear all expired peers. If you not want it be cleared,you can use

rtautoclear=no

Why it not clear if you wait 3 minutes? Peers just do re-registration and UPDATE info in database.

0
votes

To save expired realtime peers rtautoclear=no should be used. However, saving peers doesn't mean they will be available. To keep them available and "callable" I used ignoreregexpire=yes option. More parameters may be found in the page below:

http://www.asteriskdocs.org/en/2nd_Edition/asterisk-book-html-chunk/asterisk-APP-A-SECT-2.html