[asterisk-dev] avoid public IP address in conf
Francesco Pasqualini
frapas at gmail.com
Wed Oct 5 13:21:29 CDT 2016
Hi,
why we need to specify the public (external) IP address when asterisk is
behind NAT ?
With stun, asterisk should be able to get this info by himself.
In bash for example we can get the public IP contacting the stun server:
echo -en '\x00\x01\x00\x08\xc0\x0c\xee\x42\x7c\x20\x25\xa3\x3f\x0f\
xa1\x7f\xfd\x7f\x00\x00\x00\x03\x00\x04\x00\x00\x00\x00' | nc -u
-w 2 stun.l.google.com 19302 |
dd bs=1 count=4 skip=28 2>/dev/null |
hexdump -e '1/1 "%u."' |
sed 's/\.$/\n/'
http://askubuntu.com/questions/95910/command-for-determining-my-public-ip
If we can avoid to specify the public IP we can support dynamic IP. Before
connecting, asterisk could retrieve the public IP. That is what (I think)
is doing my IP phone at home, dynamic IP behind Nat. It ask me only the
stun server address.
thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20161005/7b193d2f/attachment.html>
More information about the asterisk-dev
mailing list