The Opus codec for Asterisk exposes a few configuration options that allow adjustments to be made to the encoder. The following options can be used to define custom format types within the codecs.conf file. These custom format types can then be specified in the "allow" line of an endpoint.
|type||Must be of type "opus".||"" (empty string)|
Encoder's packet loss percentage. Can be any number between 0 and 100, inclusive. A higher value results in more loss resistance.
Encoder's computational complexity. Can be any number between 0 and 10, inclusive. Note, 10 equals the highest complexity.
Encoder's signal type. Aids in mode selection on the encoder: Can be any of the following: auto, voice, music.
Encoder's application type. Can be any of the following: voip, audio, low_delay.
Sets the "maxplaybackrate” format parameter on the SDP and also limits the bandwidth on the encoder. Any value between 8000 and 48000 (inclusive) is valid, however typically it should match one of the usual opus bandwidths. Below is a mapping of values to bandwidth:
Sets an upper bandwidth bound on the encoder. Can be any of the following: narrow, medium, wide, super_wide, full.
Specify the maximum average bitrate (sdp parameter "maxaveragebitrate"). Any value between 500 and 512000 is valid. The following values are also allowed: auto, max.
Sets the "cbr" (constant bit rate) format parameter on SDP. Also tells the encoder to use a constant bit rate. A value of no (0 or false also work) represents a variable bit rate whereas yes (1 or true also work) represents a constant bit rate.
|fec*||Sets the "useinbandfec" format parameter on the SDP. If set, and applicable, the encoder will add in-band forward error correction data. A value of no (0 or false also work) represents disabled whereas yes (1 or true also work) represents enabled.||0|
|dtx*||Sets the "usedtx" format on the SDP. A value of no (0 or false also work) represents disabled whereas yes (1 or true also work) represents enabled (usedtx).||0|
*If the format parameter is set to its default it will not show up in the fmtp attribute line.
Limit the maximum playback rate of any endpoint that allow "opus" and don't include any forward error correction.
Limit endpoints that allow "myopus" to wide band and use a constant bit rate: