Hello, I am looking for a little guidance to help me get to the bottom of some Asterisk configuration issues. I have a little Asterisk server at home. Originally I was just going to use it to screen calls at home which is working well, but then I got the idea to setup a SIP client on my mobile so that I could have the convenience of answering and making calls on the home phone from my mobile… Too easy, I thought. Open a few ports… After many late nights, packet tracing and reading up on SIP and SDP I feel no closer to solving this problem.
My home network is quite simple. Asterisk resides on a LAN along with all the other devices at home. A router sits in between me and the internet. As long as I keep my calls internal to the home network, everything works just fine. When I flick my mobile over to 4G and make a call, it may work or not depending on what mood Asterisk is in(well actually I am editing the config quit a bit to troubleshoot, at this point I don’t even know what it’s doing!).
For starters, my 4G carrier uses CG NAT. I can tell this from tracing packets on the Asterisk box, I can see a 10.x.x.x address in the Contact: field in the 200 OK packet. My home connection uses a Dynamic IP address. I am using a dynamic DNS service.
My home router has ports for SIP and RTP forwarded to my Asterisk box.
I have just decided to focus on one issue for now. Calls from my phone(on 4G) to Asterisk. I am making calls to an IVR which I have constructed. When my phone is on the LAN, no problems when I dial the IVR. On 4G, the call is Answered by Asterisk but is dropped due to missing a critical packet. Research tells me this is a missed ARP. My mobile is failing to send the ARP after 200OK from the server. I have confirmed this with wireshark. BTW, I don’t hear any audio on this call. Classic NAT I am told.
I have tried toggling STUN on my mobile.
In my sip.conf I have the following NAT related lines specified:
[general]
localnet=x.x.x.x
externhost=myddnsname:andaport
externrefresh=180
[sipuser]
nat=auto_force_rport,auto_comedia
directmedia=no
Have tried a bunch of combinations but nothing is working for me.
I should mention the mobile client ONLY connects via TCP when I am on 4G, I am not sure why but it seems like that is the way it is.
Anyhow not really sure where to go from here. Any advice or pointers greatly appreciated.