Having trouble with externalip

I am trying to get a home asterisk server set up with a sip trunk group that i will use for LD. The server is behind a firewall. Calls between UAs in my local network work fine. I am able to set up calls on the external sip trunk group but no sound.

Obviously some sort of NAT issue.

Sniffing the packets on the external side of the router, i can see that the SDP portion in the SIP invite is using the internal 192.168.x.x address and not the external one that i have specified. I suspect this is why i never get RTP back.

in the [general] section of sip.conf i have:

externalip=(my external ip, at least for now)
localnet=192.168.1.0/255.255.255.0

and also
nat=yes (but i think this has more to do with how asterisk responds to invites then how it initiates calls)

shouldnt that be enough?
thanks!!

It’s not externalip, but it’s externip :wink:

Try this:

externip=(my external ip, at least for now)
localnet=192.168.1.0/255.255.255.0

What version of Asterisk are you running?

externip instead of externalip helped. Now I can see the external address in the SIP packets.

Still no RTP hitting the outside of the router though. I am not sure if it is the service provider i am trying to trunk with, my dsl modem (firewall disabled), or my ISP.

Set up is a dsl modem, going to a linksys WRT54GL loaded with Tomato firmware, and asterisk 1.8 on ubuntu 12.04, and a couple of sip clients on the same network as the server, and the above-mentioned non-functional sip trunk to an external provider. I have turned off the firewall on the modem, and set port forwarding up in the linksys so that UDP 5060 and UDP 10000 - 20000 go to the asterisk server. I have tcpdump set up on the router so I can monitor each of the interfaces. right now I am looking at the one between the dsl modem and the router. I Can see the SIP, see my outgoing RTP, but no RTP coming back.

Is there a service that will ping you with RTP packets so you can see if they are getting through?

add the " media_address=external ip" options too.

media_address did not take care of it. I am thinking of trying another sip trunk provider, with pay-as-you-go (not monthly) pricing.

Make a sip trace and check the media address and the contact address on the SDP message

Put your server into the DMZ on the router and test, also have you turned off the IP tables on the server (if installed/running) and retest ?

I had a few problems going on

one was that the server i was trying to build in IP trunk group with was not sending me back RTP. When i switched to voip.ms I had much better luck. (good rates and decent quality so far as well!)

The second problem is that my IP address changed sometime earlier this week and externip stopped working. I now have externhost and externrefresh with a dynamic dns server.

The third problem is that when i specified media_address than my local phone on the network started using that external ip address for RTP. This probably should have worked if I had my local routing tables correct, but they ended up getting routed out my gateway instead of the asterisk server and not making it back. Removing this parameter worked fine

Thanks to all of the techies out there! I have another SIP URI dialplan question but i will start a different thread.