Hi all,
For those who are interrested in the topic ...
- By enabling the dnsmgr into asterisk ( see dnsmgr.conf ), dns updates seems to come on due time, 'chan_iax2.so' is good updated.
- Nat router capabilities seems to be major concern. I have a router that supports 'consistent NAT' , no problem at my side. The other end uses another NAT router that looks to be 'too basic' and needs to be resseted when remote end IP changes. ( router still sending IAX Pokes to the 'old address' destination, even if the good ip is asked by 'chan_iax2.so'. ).
- Little script to be able to follow/test stability (/etc/cron.hourly) :
#!/bin/sh
#peermonitor.sh
#Due to Dynamic IP addressing, peers may be lost when IP changes locally of remotely.
#Goal of this script is to have a quick and dirty monitoring that restarts the pipe when needed.
#Peername to monitor
peername="the_peer_to_be_monitored"
#Let's check the current peering status
/usr/sbin/asterisk -rx 'iax2 show peer '$peername > peer_status
sleep 1
#Let's scan the peer_status. If 'Status & OK' can be found on the same line in the answer, it's OK !.
test="Status.*OK"
if grep -in $test peer_status > /dev/null
then
# Nothing to do since it is OK ... just info log.
echo `date` " -- Peer monitor check OK -- " >> /var/log/asterisk/peermonitor
exit
fi
# Oops, it is not 'OK'.
# Reloading the PBX seems to help.
# Another solution is to restart PBX when no calls ...
/usr/sbin/asterisk -rx 'reload'
# /usr/sbin/asterisk -rx 'restart when convenient'
# Let's log the issue ( gives an idea of occurences, or send a warning mail ... or both ! )
# Logfile will appear in the asterisk journal 'peermonitor'
# echo "Peer monitor alert. Asterisk reloaded" | mail -s "Asterisk peermonitor event report" yourmail@youraddress.net
echo `date` " -- Peer monitor alert. Asterisk reloaded -- " >> /var/log/asterisk/peermonitor
Best,
Hervé