Inside the Media Plane: Codecs, Fast-Path Relay and Audio You Control
The media plane is where a telephony platform earns its keep: pick the right codec, decide what gets transcoded, and manage every sound callers hear. RustPBX’s media engine is shared by SIP, WebRTC, queues, IVR, and recording — one pipeline, one set of behaviors.
Codecs, Per Endpoint
G.711 a/µ, G.729, G.722, Opus, and iLBC are supported, selectable per trunk or per extension. That granularity matters:
- Legacy carrier leg on G.729, browser agent on Opus → the bridge transcodes once
- Both legs G.711 → the fast path relays without touching the samples
- Per-trunk codec lists prevent a misconfigured endpoint from offering something the carrier rejects
The Fast Path
Same-codec transport combinations are relayed directly — no decode/encode cycle. When codecs differ, the transcode path engages. In practice this means:
| Scenario | Path |
|---|---|
| SIP ↔ SIP, same codec | Relay (cheap) |
| WebRTC ↔ SIP, same codec | Relay with DTLS/SRTP rewrite |
| Different codecs | Transcode (CPU) |
| Conference with mixed codecs | Mixer + transcode per outlier leg |
Capacity planning follows: transcode-heavy profiles cost more per call than relay-heavy ones (see performance).
Comfort Noise and Silence
Digital silence confuses some endpoints and callers alike. The media engine can emit comfort noise instead of silence when a leg’s egress has no source:
[media]
comfort_noise = true
comfort_noise_level_db = -35.0
Small switch, disproportionately large effect on call quality perception.
Every Sound You Can Control
- Queue hold music — PBX-wide default (
queue_hold_music) with per-queue override - Voicemail greeting — PBX-wide default (
voicemail_greeting) with per-app override - Early-media loops — busy-wait (camp-on) plays hold audio while re-dialing a busy extension
- One-leg playback —
media.playacceptsside_onlyso prompts play to a single party (host instructions the guest can’t hear) - TTS anywhere — IVR prompts, voicemail greetings, and announcements can synthesize at runtime with prompt aliases
Media Quality Evidence

The media plane reports on itself: per-call RTCP statistics (loss %, jitter, RTT) land in the CDR, silent legs are flagged proxy.leg_media_incomplete, and stall detection attempts recovery when a flow goes quiet. For carrier disputes, these are the numbers that end the conversation.
ICE and Transport Flexibility
Plain-RTP legs can advertise ICE-lite for strict peers; WebRTC legs always run full ICE. Media proxying is per-trunk (all / auto / nat / none / bypass) and there’s a per-dialplan relay_only escape hatch for networks where direct paths never work.
Guides: Trunk & Media and Technical Specs.