NAT: No Audio in Outbound Calls, One-Way(Incoming) audio in Inboud Calls, Extension to Extension Ok

Hello, I’ve been facing for the past few days and perhaps my limited knowledge of reading packet trace has made me unable to find a solution yet.
Here’s the setup:
FreePBX Server is in a NATed environment. Extensions are connecting to the server using a VPN, I’ve tried almost all combination of the following SIP settings: NAT, Qualify, Careinvite, RTPKeepalive, Externip, Localnet and a few more.
If the issue is not clear from the title, here’s a detailed explanation:

  1. Inbound Calls from External Number: The Extensions can hear audio, but the caller(Mobile Phone) cannot hear any audio.
  2. Outbound Calls to External Number: There is not audio on either side
  3. Extension to Extension: This is working fine

Network Details:
Sip Phone IP: 10.113.100.9
Server IP: 172.18.2.211 (Local), 116.66.197.119(External)
SIP Provider: 10.40.30.4

SipTrunk Conf:
disallow=all
[email protected]
type=peer
secret=pwd
qualify=yes
nat=force_rport,comedia
insecure=invite,port
host=10.40.30.4
outboundproxy=10.40.30.4
outboundproxyport=5060
fromdomain=providerdomain
dtmfmode=inband
context=from-trunk
allow=alaw,ulaw,g722
realm=providerdomain
usereqphone=yes

Any help is highly appreciated.

Here’s the trace:(Not allowed to post two photos, hence merged)

Why have you specified an external address for your server, when the service provider appears to be on an internal network?

The IP addresses in your configuration are not consistent with your summary or with the images. The configuration doesn’t appear to be the one actually in use!

Is this a double NAT case, with NAT between the server and the provider and also NAT between the server and the public network? Such configurations are messy because they really stretch internet protocol routing.

Your outbound call hasn’t got beyond ringing, and isn’t using early media, so one would not expect any audio end to end, Similarly for the inside leg of the incoming call

Thanks for the reply David. We’re connected to the sip provider through a fiber cable.
SIP Provider has provided the Gateway 10.59.250.9 for connection and this is all configured in the Router. Routing in not done in the FreePBX server itself.
I am using VPN to connect to the server and the IP 10.113.100.9 is assigned by the VPN to the Soft Phone.

In any case, I’ve tried with nat=no, and without exterip too, the issue still persists.
I’ve edited and corrected the sip provider address.

nat=no doesn’t do what people think it does. It actually disables automatic behaviour to cope with, typically extensions, which are inside NAT, when Asterisk is outside. nat= isn’t useful in the typical case of Asterisk inside and ITSP outside.

As I said, your images show calls which haven’t got beyond ringing and are not using early media on both legs. The lack of media on the B side is completely normal, at that stage of the call. It simply will not be possible to send media to the B side, as, only when the OK arrives, will Asterisk know where to send it. (It is technically possible to receive the media address on Ringing, but your trace doesn’t provide enough information to know if that is happening - i.e. that SDP is included).

I think I may have been confused by the provider’s media address differing from their signalling address. The signalling address is (now) matching the configuration.

You will, almost certainly, need directmedia=no, on both sides, in this configuration, because of the lack of routing between provider and VPN sub-networks. This was called canreinvite=no, until about a decade ago. However, your traces end a long way short of where that matters.

Please provide a log that properly shows the SIP details:

At the Asterisk command prompt, type
sip set debug on
You should see
SIP Debugging Enabled
Then make a test inbound call. Paste the Asterisk log for the call (which will include the SIP trace) at pastebin.freepbx.org and post the link here. Do the same for an outbound call.

If you are too new to post links, just post the last eight hex characters of the link URL.

The Asterisk log is at /var/log/asterisk/full , or can be viewed in the GUI at Reports -> Asterisk Logfiles.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.