DevSteven Services

Codecs

Opus codec and Opus recording for Asterisk

Opus is the codec of WebRTC and of most modern softphones and apps. We add it to Asterisk 16 as a native codec, and add the ability to save call audio as Opus files, so quality is kept from the wire to the recording.

The problem

Without Opus, every call from a WebRTC client or modern app is transcoded to G.711, losing quality and burning CPU. Recordings are made in a narrowband format, throwing away the fidelity the call had.

What we change

  • Opus codec module (codec_opus), built on libopus, registered as opus. It negotiates per RFC 7587.
  • Opus recording (format_ogg_opus): calls can be written as .opus files (Ogg encapsulation, RFC 7845), so recordings keep full fidelity at a small size.
; sip.conf
allow=opus

; dialplan: record in Opus
exten => s,1,MixMonitor(${UNIQUEID}.opus)

SDP

m=audio 20000 RTP/AVP 111
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10;useinbandfec=1

Notes

  • The module is built from the open-source libopus, opusfile and opusenc libraries, installed once on the build host.
  • It replaces the stock Ogg Opus format module in the build, so only one of the two is enabled.
  • Delivered as part of the same build as the mobile codecs, so one platform can bridge Opus, AMR-WB, EVS and G.711.
Asterisk16 LTS
StandardsRFC 6716 (Opus), RFC 7587 (RTP payload), RFC 7845 (Ogg Opus)

Related

Need this on your platform? Tell us the Asterisk version and the interconnect, and we reply within 24 hours.

Request a quote