Skip to content
Phone Guides

Asterisk codecs and transcoding

A configured codec list describes a policy. The codec negotiated on a particular call leg and any conversion Asterisk performs are runtime facts. Keep all three distinct when diagnosing audio or estimating host load.

Source-reviewed, 18 October 2026. Prepared from the cited documentation. Examples and performance have not been independently tested by Phone Guides. Scope: Asterisk 22/PJSIP audio calls; no measured call count or endpoint compatibility is claimed.

Read the policy first

An endpoint can restrict its allowed codecs. The introductory two-phone example uses the following policy fragment:


disallow=all
allow=ulaw,alaw

Those names select G.711 variants in Asterisk's configuration vocabulary. The actual endpoint must support the permitted codecs, and the required codec modules must be available. An allowed value in a file is not proof that a usable path was negotiated.

Use the branch-22 PJSIP reference for endpoint options. For broader codec planning, use the Phone Guides codec reference without treating planning figures as measurements of your call.

Inspect both legs

In a call between two endpoints, Asterisk can have separate media negotiations on the incoming and outgoing sides. A codec preference at one endpoint does not by itself tell you the final format on the other leg. Compare the offer/answer and actual channel information for both.

The upstream advanced codec negotiation guide describes the negotiation stages. It includes a historical development preface, so use it for the model and compare configuration details with the current branch reference and installed help. Do not copy its example defaults as a claim about every patch.

Distinguish conversion from pass-through

When legs use different audio formats and Asterisk handles the media, it needs a supported translation path. A module being available does not establish that every codec pair, recording format or bridge mode can use it. Direct media, recording, conferencing and application processing can change the work required.

Question Reader evidence
What codecs are configured? Loaded endpoint policy
What did each side negotiate? Offer/answer and channel media information
Can this build translate the formats? Loaded codec modules and translation information
What load does the call create? Measurements on the actual host and workload
Is the audio path usable? Two-way audio and media-path checks

Consult the installed CLI's help for format, codec and translation inspection commands. core show channel with an actual active channel name can help connect media observations to a particular call leg. Do not substitute a generic codec benchmark for call-path evidence.

Explain failed negotiation carefully

A call rejected during media negotiation may have no acceptable format under the configured policy. Read the response sequence and the application's log context before assigning a cause. Changing to an unrestricted codec list can obscure the mismatch and permit a format the rest of the system does not handle as intended.

If a call answers but audio is missing, also inspect advertised addresses and RTP. Codec agreement does not establish reachability. If speech works but digits fail, examine DTMF separately.

Measure before promising a host size

For sizing, record concurrent calls, codec mix, conversion, packetisation, recording/conferencing, encryption and logging. Keep host CPU/memory and the workload together with the result. A historical book's hardware table or a codec's nominal payload rate is not evidence for the number of calls your server can handle.

Preserve the previous endpoint policy, apply one justified change and inspect a new call. Record whether the intended format and behaviour actually changed. Return to Asterisk documentation.