Giter VIP home page Giter VIP logo

asterisk-opus's Introduction

Opus Codec for Asterisk

Digium, currently do not provide an ARM binary version of opus codec for Astersik.

Since Asterisk 13.12 (and Asterisk 14.0.1), Opus is not only supported for pass-through but can be transcoded as well. This allows you to translate to/from other audio codecs like those for landline telephones (ISDN: G.711; DECT: G.726-32; and HD: G.722) or mobile phones (GSM, AMR, AMR-WB, 3GPP EVS). This can be achieved by enabling codec_opus via make menuselect.

This repository is for Asterisk 13+ when building from source for ARM based CPU.

Prerequisites

At least Asterisk 13.7 is required.

Install libraries:

To support transcoding, you’ll need to install an Opus library, for example in Debian/Ubuntu:

$ sudo apt-get install libopus-dev libopusfile-dev

Update Asterisk:

$ git clone https://github.com/InnovateAsterisk/asterisk-opus.git
$ cp ../asterisk-opus/include/asterisk/* include/asterisk
$ cp ../asterisk-opus/codecs/* codecs
$ cp ../asterisk-opus/res/* res

Codec Configuration

You cannot use codecs.conf to change the configuration of the audio when transcoding. Remember that while not transcoding or when your client device is encoding the audio (like in Chrome/Firefox etc) Asterisk is not encoding the audio so codec config options are not applicable. However if you want to have transcoding TO opus, and you want to change the way Asterisk encodes the audio you have to change the file include/asterisk/opus.h and re-make Asterisk. The binary module from Digium supports the configuration file codecs.conf.

Optional

(Optionally) apply the patch for File Formats (untested):

Two format modules are added which allow you to play VP8 and Ogg Opus files without transcoding.

cp --verbose ./asterisk-opus*/formats/* ./formats
patch -p1 <./asterisk-opus*/asterisk.patch

(Optionally) apply the patch for Native PLC (experimental):

Out of the box, Asterisk does not detect lost (or late) RTP packets. Such a detection is required to conceal lost packets (PLC). PLC improves situations like Wi-Fi Roaming or mobile-phone handovers. This patch detects lost/late packets but is experimental. If your scenario requires PLC and you find an issue with this patch, please, continue with ASTERISK-25629…

patch -p1 <./asterisk-opus*/enable_native_plc.patch

Run the bootstrap script to re-generate configure:

./bootstrap.sh

Configure your patched Asterisk:

./configure

Enable slin16 in menuselect for transcoding, for example via:

make menuselect.makeopts
./menuselect/menuselect --enable-category MENUSELECT_CORE_SOUNDS

Compile and install:

make
sudo make install

Alternatively, you can use the Makefile of this repository to create just the shared libraries of the modules. That way, you do not have to (re-) make your whole Asterisk.

Thanks go to

  • Opus team,
  • Ron Lee packaging the libraries for Debian/Ubuntu,
  • Lorenzo Miniero created the original code for Asterisk 11,
  • Tzafrir Cohen drove the pass-through support for Asterisk 13,
  • Sean Bright ported the transcoding code over to Asterisk 13, added many changes directly into Asterisk 13, and maintained the port until Asterisk 13.11.

asterisk-opus's People

Contributors

traud avatar seanbright avatar innovateasterisk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.