Howwise RSS
VoIP & Phone Systems10 min read

FreePBX One Way Audio on Remote Phone Behind NAT: Fix It

Short answer

FreePBX one way audio on a remote phone behind NAT is almost always a wrong address in the SDP or blocked RTP, not a registration fault. Set External Address and Local Networks, enable RTP Symmetric, Force rport and Rewrite Contact, and open UDP 10000-20000.

Key takeaways
  • Registration only proves SIP signalling works; audio travels separately as RTP over UDP 10000-20000 by default.
  • A private address (192.168.x.x or 10.x.x.x) in the c= line of the SDP sent to a remote phone is the classic cause of one way audio.
  • Set External Address and Local Networks in Asterisk SIP Settings, and never list the remote phone's subnet as a local network.
  • Disable SIP ALG on the remote router and on the PBX site's firewall before changing anything else on the phone.
  • Prove the fault with sngrep or a tcpdump capture: RTP in one direction only points to a firewall, NAT or address problem.

Which direction is failing, and what does it point to?

Start with who cannot hear whom, because the direction of FreePBX one way audio narrows the layer at fault. A phone that registers and rings has proven only that SIP signalling (UDP or TCP 5060, TLS 5061) works. The audio is RTP, a separate set of UDP flows on different ports, and it can fail while signalling looks perfect.

Every call has two RTP directions. The PBX must send audio to an address the phone can receive on, and the phone must send audio to an address the PBX can receive on. Each address is announced in the SDP body of the INVITE and the 200 OK, so a wrong address there breaks one direction.

SymptomMost likely causeLayer to check
Remote user hears nothing, PBX side hears the remote userPBX sends RTP to a private address or the packets are dropped on the way backFreePBX External Address, Local Networks, Rewrite Contact, remote router SIP ALG
Remote user hears the caller, PBX side hears silencePhone sends RTP to a private IP, or the PBX firewall drops itPhone NAT settings, RTP Symmetric, FreePBX Firewall RTP service, cloud security group
No audio either wayBoth RTP flows blocked, or direct media attemptedDirect Media, RTP port range, upstream firewall
Audio works, then dies after 30 to 120 secondsNAT mapping expired on UDPKeepalive interval, router UDP timeout
Audio works only on some calls or transfersDirect media re-INVITE between two remote phonesDirect Media = No on all extensions
Tip: If local phones on the office LAN work fine, leave their settings alone. Every fix below is aimed at remote endpoints, and most can be applied per extension or per network without touching the working ones.

How do I fix FreePBX one way audio with the NAT settings?

FreePBX decides whether a peer is local by comparing its address to the Local Networks list. If the peer is local, Asterisk puts the PBX's private address in the SDP. If the peer is not local, it substitutes the External Address. Wrong values here produce a private address in the SDP sent to the remote phone, which is the most common cause of FreePBX one way audio.

In FreePBX 16 and 17 the GUI path is Settings > Asterisk SIP Settings. The General tab holds External Address and Local Networks, and the SIP Settings [chan_pjsip] tab holds the equivalent transport values.

  1. Open Settings > Asterisk SIP Settings > General SIP Settings.
  2. Set External Address to the PBX's static public IP, or click Detect Network Settings. Use an IP, not a hostname, unless you are certain it resolves from the PBX itself.
  3. Under Local Networks add every internal subnet the PBX can reach directly, for example 192.168.1.0/24 and any VoIP VLAN. Do not add the remote workers' subnets.
  4. Open the SIP Settings [chan_pjsip] tab and, on the transport you use (usually 0.0.0.0-udp), set External Signaling Address, External Media Address and Local Network to the same values.
  5. Submit, then click Apply Config. Run fwconsole restart (or restart Asterisk) if you changed a transport, because transport changes are not always picked up by a reload.
; what FreePBX generates in pjsip.transports (example values)
[0.0.0.0-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
external_media_address=203.0.113.10
external_signaling_address=203.0.113.10
local_net=192.168.1.0/255.255.255.0
Warning: A restart drops active calls. Make the change out of hours, and do not click the restart option while users are on calls.

Which per-extension settings fix remote phones that advertise private addresses?

Even with the transport correct, a phone behind NAT puts its own LAN address in its Contact header and SDP. Asterisk has to ignore those and reply to the packet's real source instead. Open Applications > Extensions, edit the extension and go to the Advanced tab in the PJSIP settings.

These settings together implement symmetric NAT handling for that endpoint.

SettingValueWhy
Direct MediaNoKeeps RTP flowing through the PBX so it never tries to connect two private networks to each other
RTP SymmetricYesSends RTP back to the address and port the phone's RTP came from
Force rportYesReplies to the real source port instead of the Via port the phone claims
Rewrite ContactYesReplaces the private Contact address with the observed source, so in-dialog requests reach the phone
Media EncryptionNone unless both sides use itSRTP on one side only gives silence with no obvious error
; legacy chan_sip equivalent, per extension
nat=force_rport,comedia
directmedia=no

Is the RTP port range open on the PBX firewall and cloud?

Opening 5060 or 5061 alone is not enough. Asterisk uses the range in Settings > Asterisk SIP Settings > RTP Settings, which defaults to 10000-20000 UDP. Each call consumes a pair of ports, so a small business rarely needs the whole range.

With the FreePBX Firewall module (Connectivity > Firewall), add the remote phone's public IP to the Trusted zone, or assign the zone that carries the RTP service. If the remote IP is not in any zone that allows RTP, the PBX drops the media while registration may still succeed. From the shell you can add one with fwconsole firewall trust 203.0.113.50.

You can narrow the range, for example 10000-10500, which supports roughly 250 simultaneous calls at one port pair each. Set the same range in RTP Settings and in every upstream rule, then reload. A mismatch is a classic cause of audio that works on some calls and not others.

Upstream devices need the same rule: a cloud security group, a hardware firewall in front of the PBX, or a port forward. Allow UDP for the whole RTP range to the PBX, not just 5060.

# confirm which RTP range Asterisk actually uses
asterisk -rx "rtp show settings"

# see whether the FreePBX firewall is dropping the remote IP
iptables -L -n -v | grep 203.0.113.50
Warning: Do not open 5060 and the RTP range to the whole internet without protection. Keep Fail2ban and the FreePBX Firewall active, or restrict by source IP, because exposed SIP gets scanned within hours.

Why do cloud PBXs and overlapping subnets cause one way audio?

On AWS and similar clouds, the instance only knows its private VPC address because the public IP is a 1:1 NAT outside the machine. Set External Address to the public IP, and make sure Local Networks includes the VPC subnet, for example 10.0.0.0/16. If the VPC subnet is missing, Asterisk may treat private traffic as external. If the External Address is missing, the SDP carries the private address.

Overlapping subnets are the trap generic guides skip. If a remote worker's home LAN is 192.168.1.0/24 and the office is also 192.168.1.0/24, Asterisk matches the phone's reported address against Local Networks and concludes the phone is local. It then sends the private PBX address and RTP goes nowhere.

Removing the subnet from Local Networks would break the real office phones, so the proper fixes are different: renumber the remote LAN, or put the remote phone on a WireGuard VPN with a unique tunnel address, or terminate remote users on an SBC. For many remote users a VPN or SBC is more reliable than tuning each home router.

What phone and router settings matter?

Home routers drop idle UDP mappings quickly, so the phone must keep the path open. On Yealink, go to Account > Advanced and set NAT: Keep Alive Type to Default or Options with an interval of 30 seconds. On Grandstream, enable NAT Traversal keep-alive. Keep Use Outbound Proxy off unless you deliberately run one, and make sure RTP symmetry (rport) is enabled on the account.

The biggest router-side culprit is SIP ALG. It rewrites SIP and SDP addresses and often breaks them, and you must disable it on the remote router and on the PBX site's firewall. Look for it on ISP routers, pfSense, UniFi, MikroTik and similar firewalls, where it is sometimes called SIP helper or SIP fixup.

STUN is a last resort. It helps the phone learn its public address, but it fails with symmetric NAT, because the mapping differs per destination. Prefer fixing the PBX side first.

For softphones such as Zoiper, turn off ICE if it conflicts with the PBX's behavior, and use matching codecs. G.711 (ulaw or alaw) is the safest test, and Opus works only if it is enabled on both the endpoint and the trunk or extension.

Tip: If audio dies after a fixed time, such as 30 or 60 seconds, suspect a UDP NAT timeout. Set the keepalive interval below that value.

How do I prove the cause with a capture?

Capture on the PBX while reproducing one failed call. sngrep shows the flow live, while tcpdump gives a file for Wireshark.

In the INVITE and 200 OK, read the SDP c= line (connection address) and m=audio line (port). A 192.168.x.x or 10.x.x.x address in what the PBX sent to a public phone is the smoking gun for FreePBX one way audio. Then open Wireshark and go to Telephony > RTP > RTP Streams, where each call should show two streams, one per direction.

What you seeMeaningFix
Private address in SDP c= line sent by the PBXWrong or missing external addressExternal Address, Local Networks, External Media Address
Private address in the phone's SDP, PBX replies to itNo symmetric RTP handlingRTP Symmetric, Rewrite Contact, Force rport
PBX sends RTP, nothing returnsRemote router, ALG or phone firewallDisable SIP ALG, check the phone's NAT settings
No RTP arrives at the PBX at allPort range closed, or Fail2ban or Firewall blockingRTP range, trusted zone, upstream rules
RTP arrives both ways but silenceCodec or SRTP mismatchAlign codecs, set Media Encryption on both sides
# live view of SIP and RTP
sngrep -d any

# capture for Wireshark
tcpdump -i any -n -s0 -w /tmp/oneway.pcap udp port 5060 or portrange 10000-20000

# Asterisk CLI view
asterisk -rvvv
pjsip set logger on
rtp set debug on
# look for "Got RTP packet from" and "Sent RTP packet to"
# turn it off afterwards
rtp set debug off
pjsip set logger off

Which mistakes keep the fix from working, and what is the order to test?

The usual errors are repeatable. Changes were saved but Apply Config was not clicked, or a transport change was applied without a restart. The External Address is a hostname that does not resolve. The remote subnet was added to Local Networks. There is double NAT on the PBX side or at the remote site. SRTP is enabled on only one side.

Work through the layers in order of likelihood, and change one thing at a time.

  1. Confirm the failing direction with a test call to an extension and an outside number.
  2. Check the SDP c= line in sngrep and fix External Address, Local Networks and the PJSIP transport values.
  3. Set Direct Media No, RTP Symmetric Yes, Force rport Yes and Rewrite Contact Yes on the remote extension, then Apply Config.
  4. Verify the RTP range matches in Asterisk, the FreePBX Firewall, and every upstream firewall or security group.
  5. Disable SIP ALG on both routers and set a 30 second keepalive on the phone.
  6. Test with G.711 and without SRTP, then re-enable what you need.
  7. If subnets overlap or there are many remote users, move them to a VPN or SBC.

Common questions

Why does one way audio only happen on remote phones and not local ones?

Local phones share a routable network with the PBX, so the private addresses in SDP are valid. Remote phones sit behind NAT, so any private address in the SDP points nowhere, and the router may also drop unsolicited inbound RTP.

Do I need to forward RTP ports on the remote router?

No. The remote phone sends RTP outbound first, which opens a NAT mapping, and the PBX replies to that source when RTP Symmetric is on. Port forwarding on the home router is unnecessary and usually a sign the PBX settings are wrong.

Can I fix this with STUN instead of PBX settings?

Sometimes, if the remote router uses a simple cone NAT, but it fails with symmetric NAT and it leaves the PBX advertising wrong addresses to other peers. Correct the External Address and per-extension NAT settings first and use STUN only if needed.

Why does audio work for a minute and then stop?

The router is expiring the idle UDP mapping, or a firewall state timer is closing the RTP flow. Set the phone keepalive to 30 seconds or less, and check whether the router has a short UDP timeout.

Is it safe to just open UDP 10000-20000 to everyone?

It is risky, because exposed SIP and RTP services get probed constantly. Prefer allowing the remote phone IPs through the FreePBX Firewall, keep Fail2ban running, and consider a VPN so the ports are not public.

Related topics:freepbxone way audionatsip algrtp