Does IAX2 support Opus configuration?


I’m having no success getting Opus to use narrowband and forward error correction with IAX2. Does IAX2 support Opus only in its default configuration?

I have two Asterisk 16 servers peered with each other over IAX2. I’ve successfully placed a call between them with the Opus codec, but only, it seems, at full bandwidth - the generated IAX2 traffic is running at about 64kbps (as indicated by nload). IAX2 debugging confirms that the negotiated codec is Opus, but it doesn’t reveal any other codec parameters like the FEC flag, max playback rate etc.

I’ve tailored Opus in codecs.conf on both servers, as follows:


Although the codec name (opus8) is recognised and applied to the call, the options seem to be ignored - the IAX2 traffic is still running at 64kbps, rather than at 8kbps, and I presume that the FEC option is also ignored.

Am I doing something wrong, or are there limitations to IAX2’s support of opus?


IAX2 as a protocol has no way to communicate such things, and noone has added such functionality. To be more specific, it has no way to communicate codec parameters. It’s merely “this is opus”. That’s all.

Many thanks for your prompt reply.

To be entirely clear, does this mean that the Opus configuration instructions given at apply only to SIP and not to IAX2?

If the instructions are for SIP only, is there any other way of forcing the Opus codec to use narrowband and FEC by default, even if IAX2 cannot communicate these parameters? (For example, by installing a custom Opus codec with the parameters “baked in”)?


I would expect such things to only be effective for SIP, where it can be communicated. I don’t know of any way to force things, and can’t comment on custom codec implementations.

Many thanks for the clarification. That’s certainly explained where I’ve gone wrong! I’ll revert to using ulaw for IAX2, then. Cheers.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.