[asterisk-dev] New Sip nat feature request

Francesco Talarico f.talarico at officinezerouno.it
Sun Jun 15 19:38:17 CDT 2014


Considering the number of Asterisk deployements offering services 
behind non Sip-aware Nat devices, I'm here to dicuss the 
implementation of a new feature for Asterisk sip stack. In the 
"Asterisk general" support board I posted a simple shell script that 
determines the Wan ip address of the internet router, check whether 
the ip address has recently changed and - if it did - replaces the old 
address with the new one in the "externip=a.b.c.d" directive of 
sip.conf. The script then invokes a "sip reload".
I suggest to hardcode this mechanism in the Sip stack itself in this 
way:
1) Give the possibility to set externip as "dynamic".
2) Add the "wanipcheck" directive, that instructs the software at 
which Http URL it can determine the actual Wan ip of the connected 
internet router.
3) Use the "externrefresh" directive to set the frequency at which the 
software checks whether the wan ip address has changed, just like when 
used in combination with "externhost".
In this way Asterisk could offer a more "lightweight" and robust way 
to overcome nat issues caused by dynamic public ip addressing than the 
dns-based "externhost" mechanism.



More information about the asterisk-dev mailing list