[SPA3102] STUN NOK; No voice RX/TX


I'm trying to use a Linksys SPA3102 VoIP gateway with an Asterisk server, both located behind a NAT router, and have remote IP phones somewhere on the Net receive incoming POTS calls.

That way, I can leave for an extended week-end, and customers won’t know I’m actually handling their calls with a wi-fi phone while drinking a pina colada on the beach :wink: Yes, it’s evil.

Here’s the layout:

img526.imageshack.us/img526/7651 … undot9.jpg

So far, the remote phone rings… but I get no sound either way. I assume there’s something I must do in the SPA3102 and/or the Asterisk server so that voice packets are exchanged between the Linksys and the phone (without going through the Asterisk server for maximum performance.)

=> I already noticed something fishy on the Linksys: In Voice > SIP > NAT Support Parameters : STUN Enable=yes, STUN Test Enable=yes, STUN server=stun.ekiga.net, and EXT IP=(empty), and reboot, the Linksys doesn’t learn its public IP address (Voice > Info > System Status: External IP is empty). The IP must be forced in EXT IP for the unit to know its public IP.

Still, filling the EXT IP field doesn’t solve the problem.

=> Next, still in the NAT Support Parameters, and without knowing what I’m doint, I set Handle VIA received=yes, Insert VIA received=yes, left Substitute VIA Addr=no, Handle VIA rport=yes, Insert VIA rport=yes, left Send Resp To Src Port=no, and rebooted : Still no voice either way.

Has anyone used this type of set up successfully, and knows what must be set for it to work?

Thank you.

For those struggling with the same issue with this setup (Asterisk behind a NAT router), the solution is to use “canreinvite=no” in sip.conf’s [general] section, and not “canreinvite=yes” for any account below. That way, if I understand it right, all communications go through Asterisk.

The cause of the problem when making calls between a local SIP device (ie. on the same LAN as Asterisk) and a remote device seems to be that RTP packets contain the local device’s, non-routable IP address instead of the public IP address. The RTP protocol has no support of NAT routers.

If you want devices to exchange RTP packets directly, either use an SIP-capable NAT router, or move Asterisk in the public/DMZ instead of the private network.

Hope this helps,