PBX

PBX — Codec Configuration and Audio Quality

Supported Codecs

  • Opus — Wideband/fullband, adaptive bitrate (6–510 kbps). Best quality for WebRTC and internal calls. Requires the custom-compiled codec_opus module.
  • G.722 — HD voice (wideband), 64 kbps. Excellent for supporting desk phones.
  • G.711 ulaw (PCMU) — North American standard, 64 kbps narrowband. Universal carrier compatibility.
  • G.711 alaw (PCMA) — European standard, 64 kbps narrowband.
  • G.729 — Low-bandwidth compressed (8 kbps). For constrained links. Requires a licensed module.

Codec Priority

Set per endpoint in ps_endpoints.allow. The first mutually supported codec is selected.

Recommended for best quality (extensions):

allow = opus,g722,ulaw,alaw

For carrier trunks (G.711 only):

allow = ulaw,alaw

Transcoding

When call parties use different codecs, Asterisk transcodes in real time (adds CPU load and latency). Minimize by aligning codec lists between endpoints and trunks. Enable direct_media=yes for internal calls to let phones exchange RTP directly, bypassing the PBX.

Verifying Opus Installation

asterisk -rx "core show codecs" | grep opus

Bandwidth Planning

CodecBandwidth/callNotes
Opus~50 kbpsAdaptive; can go lower
G.722~80 kbpsHD voice
G.711 ulaw~87 kbpsIncludes RTP/IP overhead
G.729~24 kbpsRequires license