If you're stuck with 1.4, you could hack something up like this:
apt-get or yum install sofia-sip-bin
In the general section of sip.conf:
#include sip-stun_address.conf
Then create a script to launch via a cronjob, which somewhat sloppily
might look like:
update_stun.sh:
#!/bin/sh
CONFIG=/etc/asterisk/sip-stun_address.conf
ASTERISK=/usr/sbin/asterisk
ADDR=`stunc stun.unlimitel.ca -b 2>&1| grep 'local address NATed'| sed -e
's/.*NATed as //' | cut -d':' -f1`
if [ ! -z "$ADDR" ]; then
echo "externip=$ADDR" > $CONFIG.tmp
# Only reload if it has changed
if `diff $CONFIG $CONFIG.tmp >/dev/null`; then
mv $CONFIG.tmp $CONFIG
$ASTERISK -rx 'sip reload'
fi
fi
On Tue, 11 Nov 2008, Remzi Semsettin Turer wrote:
Well, your question was "can it do it" and yes it can. Upon further reading, it
looks like full STUN support is in 1.6, not 1.4 though.
Any particular reason not using externhost? If you are on a dynamic IP, you can
use a Dynamic DNS servers and it works great (at least for me, I had no issues).
-----Original Message-----
From: Liviu Toma [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2008 11:22 AM
To: Remzi Semsettin Turer
Cc: TAUG
Subject: Re: [on-asterisk] Asterisk and STUN
Thanks very much for the reply, however those articles show how to set
up a stun server. What I am looking for is how to set up Asterisk as a
STUN client so that it can detect its public IP address using STUN.
Thanks,
Liviu
On Tue, Nov 11, 2008 at 10:53 AM, Remzi Semsettin Turer
<[EMAIL PROTECTED]> wrote:
To my knowledge, yes you can. Take a look at http://www.voip-info.org/wiki-STUN
I believe 1.2 does not support it, but 1.4 does. There is some German tutorials
at http://www.asteriskpbx.de/index.php?stun
-----Original Message-----
From: Liviu Toma [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2008 9:48 AM
To: TAUG
Subject: [on-asterisk] Asterisk and STUN
Can an Asterisk server located behind a NAT router use an external
STUN service to find its public IP address (externip or externhost) ?
Thanks,
Liviu
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]