[Asterisk-Users] How to access * thru router when ip address is not known

razza rjames31 at btopenworld.com
Fri Sep 16 14:57:33 MST 2005


Colin Anderson Wrote:
>Assuming your Asterisk mail client is set up correctly, cron this twice
a day on your Asterisk box:
>ifconfig eth0 | grep "inet addr" | mail -s "My Asterisk IP address"
rarawlinson at verizon.net
>Check your mail before you call and verify that the IP address has not
changed, if it has, modify your client accordingly. 
%<--------- SNIP! --------->%

A more elegant method, which also works behind a firewall (if using
DDNS) would be the solution discussed in the 'NAT and SIP.conf update'
thread, whereby Wilson Pickett wrote:

>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

I have requested he send me/post his checker, as I am sure there are
plenty who would find this useful and if like me do not posses the
necessary skills to craft this myself.







More information about the asterisk-users mailing list