Skip to content
Phone Guides

Asterisk NAT and RTP: separate signalling from audio

Choose NAT settings from the actual network path. A server behind a router, a remote phone behind another router, and two phones on the same LAN are different cases. A copied group of NAT options may conceal that distinction.

Source-reviewed, 18 October 2026. Prepared from the cited documentation. Examples have not been independently tested by Phone Guides. Scope: Asterisk 22/PJSIP concepts and topology-based review; not a universal firewall configuration.

Map both paths

Draw the server, phones, provider, routers and any SBC/VPN. For each call direction, record the address actually used to deliver SIP messages and the media address/port advertised in SDP. Then record what NAT/firewall device sits between those endpoints.


Local phone -> Asterisk -> edge router -> provider
                   |
          Identify advertised and observed
          SIP and media addresses separately.

This sketch does not imply that audio always follows the signalling arrows. Direct media or an intermediate SBC can change the path. The architecture guide explains the distinction.

Ask which side is behind NAT

Situation Questions to answer
Asterisk behind an edge router Which public address/port represents it, and which destinations count as local?
Remote phone behind NAT Where should replies and later requests go, and where is that phone's media actually arriving from?
Two local phones Is NAT involved at all, or is this a VLAN/firewall/codec problem?
SBC or VPN in the path Which component owns rewriting and routing, and are settings being applied twice?

The official PJSIP NAT guide discusses transport-level external/local addressing and separate remote-phone options. Its port-forwarding example describes one topology, not a rule to expose those ports from every source on every deployment.

Match each option to its job

Transport configuration can describe local networks and external signalling/media addressing. Endpoint configuration can affect reply handling, contact rewriting, symmetric RTP and direct media. Read the exact option definition for the installed branch before deciding it applies. For example, changing where SIP replies go does not itself correct an unreachable audio address.

Use the Asterisk 22 PJSIP option reference and its linked sections. Do not assume a transport edit takes effect after a normal reload; follow reload and restart limits.

Investigate a missing-audio call

First establish whether each participant answered. Compare the offer/answer media addresses and negotiated codecs, then look for actual media in both directions at the relevant boundaries. An address can be valid from one network and unreachable from the other.

Inspect the configured RTP range in the effective rtp.conf and any per-endpoint/version-specific overrides before comparing it with firewall rules. Do not infer the active range from a generic example. The matching release's RTP sample reference documents resource options; RFC 3550 describes RTP rather than your site's selected port range.

If packets arrive but a participant hears nothing, continue with the codec, media-encryption and endpoint handling evidence. The absence of heard audio does not prove the network dropped every packet. If direct media is allowed, examine the phone-to-phone path as well as Asterisk's interfaces.

Make a narrow correction

Preserve the old setting, change only the value justified by the topology, apply the documented reload/restart and repeat the same call in both directions. Restrict any necessary firewall rule to the appropriate peers and actual configured transport/range. Keep management ports separate.

Successful audio on one call is evidence for that path at that time. Remote phones, hold, transfer and failover may select different media behaviour and need their own checks. Continue with first troubleshooting checks or return to Asterisk documentation.