I have an Asterisk 13.6.0 server using CHAN_SIP this server is use as the CDR registration server for my customers, so Onpremise and hosted PBXes are connected to it and is the central sever through which all calls go.
Sinds a few days i have problems with keeping the peers reachable, i am using qualify to monitor the the peers and keep NAT happy if it is used.
I have qualify=yes in the peer, and qualifyfreq=20 and Keepalive=25 in general section.
i have lowered the qualifyfreq i was qualifyfreq=60 but this did not help.
A network capture did not tell me any special, i see the OPTIONS beeing answered within ms sec
Some of the peers are even on the same subnet/switch (L2 link) and do not use NAT.
What i do mis is that Asterisk does not log the peer als UNREACHABLE, i seems to just silently remove the IP adres and set it to (Unspecified) this all seems to happen within a minute.
I even set some peers to qualify=no but after some minutes these peers also report (Unspecified) for the IP
All answers i have found did not fully resolve my issue, and i hope someone has some suggestions.
Qualify does not result in the address changing to unspecified. This will happen if the registration expires. Are these peers registering to Asterisk? Have you examined the REGISTER requests if so and looked at the expiration time?
Yes the REGISTER req. looks oke, they have an expire of 60sec of 120sec i have checked one req.
this has an expire of 120sec and i see a new REGISTER after every 105sec, which receives an OK but the IP adres is still Unspecified. even after 70 REGISTER requests.
What does the SIP/Registry astdb key do, this is still available.
Ok so after some searching if did notice a few things, the peers that have the most problems with losing their IP address to (Unspecified) seems to have a direct relation to the expire time.
I have hosts that register with an expire of 60,70,120 and 3600 sec and they all referesh 15sec before the expiration only Asterisk does not seem to update the Peer.
When looking at one of those peers wit and Expire: 60 i noticed this
sip*CLI> sip show peer customer01
* Name : customer01
Secret : <Set>
-------8<-------8<----
Expire : 59
Insecure : no
Force rport : Yes
Symmetric RTP: Yes
-------8<-------8<----
Addr->IP : xxx.46.31.xx:13458
Defaddr->IP : (null)
Prim.Transp. : UDP
Allowed.Trsp : UDP
-------8<-------8<----
Qualify Freq : 20000 ms
Keepalive : 25000 ms
I then waited less than 10sec and repeated the command
sip03*CLI> sip show peer customer01
* Name : customer01
Secret : <Set>
-------8<-------8<----
Expire : -1
Insecure : no
Force rport : Yes
Symmetric RTP: Yes
-------8<-------8<----
ToHost :
Addr->IP : (null)
Defaddr->IP : (null)
Prim.Transp. : UDP
Allowed.Trsp : UDP
-------8<-------8<----
Qualify Freq : 20000 ms
Keepalive : 25000 ms
And when i look at the ‘sip show peers’ the peer had the IP Address remove to (Unspecified)
but i only waited 10sec not 59sec as reported just before.
customer01/s (Unspecified) D Yes Yes A 0 UNKNOWN
i am now looking trough the chansip.c code and debug logs hoping to find a reason.
What could cause Asterisk to do this, what am i missing here, any suggestion is appreciated.
That was precisely my issue, so this fixed my chan_sip problem and registration stay online now.
Why i did not expect it to be a bug, but a configuration or network error on my end is that the server is running sinds the release of 13.6.0 with only occasionally (about every 4 month) registration problems with some peers, which a reboot solved and i could not investigate easy, only after our datacenter reorganisation i could suddenly not keep the peers online longer than 6hours after a reboot.
i suffice to say to many small things kept me looking at the wrong things.