[Asterisk-Users] NAT and SIP.conf update.
Wilson Pickett
spamsucks2005 at gmail.com
Tue Sep 13 05:09:00 MST 2005
> This is fine but I need to be able to modify my sip.conf (externip =
> w.x.y.z) and reload sip, does anyone know of a script/app which does an
> nslookup and modifies the conf file, then reloads sip?
What I did was to have the ip checker write a one line file called
"externip.conf" containing the line:
externip = nnn.nnn.nnn.nnn ; this is the new ip address
then in sip.conf,
#include "externip.conf" ; replace the externip= line in sip.conf with
this include
Now in your ip checker script (run every n minutes with crontab),
check the ip against an the last saved ip (in file "old_ip" for example)
if ips are the same, exit, nothing to do
if different, write the externip.conf file and
do a "sip reload" command
save the ip to the old_ip file
exit
When I couldn't get fixed ip, this worked flawlessly for months.
More information about the asterisk-users
mailing list