VoIP glossary
What is Codec?
A codec is the algorithm that converts speech into digital packets and back again, trading audio quality against the bandwidth each call uses.
Codec explained
Every VoIP call uses a codec on each leg. G.711 sends uncompressed telephone-quality audio at about 87 kbit/s per direction including overhead. G.729 compresses the same speech to roughly 31 kbit/s at a small cost in quality. Wideband codecs such as G.722 and Opus carry a wider range of frequencies for clearer voices, but only stay wideband if every hop supports them.
Both ends must agree on a codec during call setup. If they cannot, the call fails with a 488 error or a device in the middle has to transcode, which adds delay and can reduce quality. Listing codecs in the same order on your PBX and your trunk avoids most problems.
Example