Stun Enabled in Asterisk 1.6

marimarc76
Posts: 4
Member Since:
2007-06-18

Dear all

I'v installed Trixbox 2.8.0.4 in my LAN.
I'm asking how to enable stun server in trunks to voip providers and avoid port forwarding in my NATted LAN.
I've googled but i'v just found not much informations about it.
I know that Asterisk 1.6 supports stun, right?
I read that i should use the "stunaddr" parameter in trunk configuration to enable stun. I wrote stunaddr=xxxx.yyyyy.zz but i have big problems with some providers (no voice and no calls even if these provider are correctly registered).
I tried "stun set debug on" CLI command but no debug messages comes!

Someone could help me?

thanks

Marco



obeliks
Posts: 878
Member Since:
2010-03-14
Stun does not work

Stun does not work http://www.trixbox.org/forums/trixbox-forums/open-discussion/stun...

Do not waste your time, use dyndns instead



marimarc76
Posts: 4
Member Since:
2007-06-18
no stun

ok thank you very much obelisk!

I'll use externip with dyndns like in astesisk 1.4
But i have to forward ports in my router again

thank you



obeliks
Posts: 878
Member Since:
2010-03-14
You always have to forward

You always have to forward rtp ports. Stun would not help you with that. Just do not forward port 5060 ;-)
You can control the range of ports used by rtp by editing rtp.conf in /etc/asterisk
100 ports is more than plenty for a typical user.



marimarc76
Posts: 4
Member Since:
2007-06-18
Port Forwarding

I've this configuration now (the one i had in trixbox 2.6.X = asterisk 1.4):

rtp.conf:
rtpstart=8000
rtpend=20000

sip_nat.conf:
externip=xxxxxxx.homeip.net
localnet=192.168.178.8/255.255.255.0
nat=yes

Router Firewall Zyxel:
8000-20000 UDP forwarded to Trixbox
5060-5070 UDP forwarded to Trixbox

BUT.... every low price phone or ata in the market today support STUN.... so WHY ASTERISK doesn't?????



obeliks
Posts: 878
Member Since:
2010-03-14
You are doing it wrong,

You are doing it wrong, externip expects an ip as the parameter, if you want to specify a host name you need to use externhost.
You can always check what sip's idea of its external ip is by doing sip show settings
This actually should be included in the status panel instead of a lame wget against www.whatismyip.com.

BUT.... every low price phone or ata in the market today support STUN.... so WHY ASTERISK doesn't?????
have no idea, you might get an answer if you ask directly on the asterisk forum.

BTW, did I say you forward way too many ports ? You also should not have nat=yes in your config files.
You can read more about nat options here:
http://www.trixbox.org/forums/trixbox-forums/open-discussion/nat-...



stechnique
Posts: 733
Member Since:
2008-02-21
All of what obeliks said,

All of what obeliks said, plus you also have the localnet wrong.
localnet should have a subnet in it, 192.168.178.8/255.255.255.0 doesn't make sense, 192.168.178.0/255.255.255.0 would.



pezzz
Posts: 14
Member Since:
2010-05-15
if it is still not fixed

As stechnique said, localnet should be talking about a network not a direct ip
Use localnet=192.168.178.0/255.255.255.0

please note the .0 at the end of the fist section actually tells it that it is a network. you were telling it that it was an address on the network by putting .8 in there.
Hope this helps.



pezzz
Posts: 14
Member Since:
2010-05-15
quick question

Obeliks (hard to type ks at end after type asterisk so much lol), where you said "You can always check what sip's idea of its external ip is by doing sip show settings ", where is this info ?? the only ip address i could see was bindaddr=0.0.0.0

I have a problem that is doing my head in trying to get a 2.6 box to talk to a MyNetFone Trunk plan. They use invite string not registration and i need to get my external ip into the invite string.

Pezzz



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.