New Sip nat feature request

Hello to all coding gurus out there!

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.

I may also suggest Digium network administrators to offer a sort of “Whatismyip” service, e.g. by hosting a dedicated web server that responds to clients by simply returning their ip address extracted from server access logs.

Any comments would be highly appreciated!