Asterisk SIP trunk with 2 NIC

Dear friends,

I have a problem with Asterisk Server in connect to SIP Provider. Please help me. Thanks.
Here are information about Asterisk Server below :

  • Asterisk has 2 NIC : eth0 with IP 10.0.0.2 , eth1 with IP 10.165.1.30

  • eth0 with NAT (internet FTTH), used for many SIP client with NAT mode.

  • eth1 with no NAT (used leased line) to connect SIP Provider with SIP Trunking (peer-to-peer).

  • For local calls : internal calls is OK (configure in SIP setting with NAT = yes, localnet = 10.0.0.0/255.255.0.0, externip = 118.69.68.15)

  • For PSTN : call in without voice, call out hangup with error “488 = Not Acceptable Here” from Provider Server.

  • About routing IP (layer 3) : routing with 2 NIC for Asterisk is OK (check with ping, tracert, and SIP message debug).

  • About SIP connection (layer 7): After check debug, i found that a problem in Contact in SIP message from Asterisk.

  • Contact: sip:19001234[color=#BF4000]@118.69.68.15 [/color]in SDP session. So the SIP Provider deny calls because of the wrong IP in Contact. Now, i want to change SIP Message Contact sip:19001234@10.165.1.30 to the provider accept calls. However, i don’t know how to change the information. Please help me soon.

PS : when i have tried to remove NAT in SIP setting , call in/call out with the provider is OK (because this time Contact in SIP Signalling will be sip:19001234@10.165.1.30). But with this configuration, SIP clients in WAN is fail. So, asterisk server can’t remove NAT in eth0.

Please provide your sip.conf. nat= probably doesn’t do what you think it does.

hi devid55,

Thank you for your reply. Here is the information i configured in sip.conf :

nat = yes
localnet= 10.0.0.0/255.255.0.0
fromdomain=voip-xx.dyndns.org

I used DynDNS service to map to IP 118.69.68.15.

nat=yes is deprecated, use nat=force_rport,comedia instead

Dear ambiorixg12,

My asterisk server is installed with asterisk 1.6, freePBX 2.9. So, there is NO options “nat=force_rport” in FreePBX to choose.

NAT has 4 options : Yes, No, Never, Route
Please see this Picture :

You are using a very old version of both softwares!

Use nat= instead. On reason for deprecation is probably that requesting everything is not what is wanted most times.

As well as using unsupported software, you haven’t told Asterisk what your public address is. Asterisk is too old to support. FeePBX isn’t supported here.

Hi David55,

I will upgrade my Asterisk System. Please recommend for me about a suitable version of Asterisk and FreePBX to fix the problem above.

Thanks & Best Regards,

The problem is almost certainly a configuration error, although I would note that improper dual homed systems are never going to be easy (i.e. ones without autonomous system numbers). For new installs of Asterisk you should use the latest non-beta/non-release candidate minor version of Asterisk 13. We have no knowledge of FreePBX.

I’m expecting to see externip, externhost, or stunaddr in the configuration.

hi David55,

I add : externip=118.69.68.15
I don’t use stun server. I also coundn’t use stun because have to record all of calls.

Best Regards,

hi friends,

The problem was SOLVED. That is simple.
I have 2 steps to setup :

  • Route SIP Provider IP range to go in eth1.
  • Add localnet for SIP Provider (add localnet for eth0, eth1 is NOT enough).