traud / asterisk-codec2

Asterisk 13 transcoding module: Codec 2
1 stars 3 forks source link

Asterisk patch for Codec 2

Asterisk already supports iLBC 30 and G.729. If you want to reduce further, you could add AMR. However, to go for even more data reduction, this patch adds Codec 2 in mode 2400.

This patch is for Asterisk 13. If you use an older version:

Installing the patch

The patch was built on top of Asterisk 13.10. If you use a newer version and the patch fails, please, report!

cd /usr/src/
wget downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
tar zxf ./asterisk*
cd ./asterisk*
sudo apt-get --assume-yes install build-essential autoconf libssl-dev libncurses-dev libnewt-dev libxml2-dev libsqlite3-dev uuid-dev libjansson-dev libblocksruntime-dev

Install library:

To support transcoding, you’ll need to install the library Codec 2. Since Ubuntu 16.04 LTS and Debian 9.0, the package libcodec2-dev is available. For earlier releases, for example Ubuntu 14.04 LTS:

sudo apt-get --assume-yes install dpkg-dev cmake debhelper libspeexdsp-dev
wget http://archive.ubuntu.com/ubuntu/pool/universe/c/codec2/codec2_0.5-1.dsc
wget http://archive.ubuntu.com/ubuntu/pool/universe/c/codec2/codec2_0.5-1.debian.tar.xz
wget http://archive.ubuntu.com/ubuntu/pool/universe/c/codec2/codec2_0.5.orig.tar.xz
tar xf codec2_*.orig.tar.xz 
cd codec2-*/
wget http://archive.ubuntu.com/ubuntu/pool/universe/c/codec2/codec2_0.5-1.debian.tar.xz
tar xf codec2_*.debian.tar.xz
dpkg-buildpackage -us -uc -nc
sudo dpkg --install ../libcodec2-*.deb

Apply all patches:

wget github.com/traud/asterisk-codec2/archive/master.zip
unzip -qq master.zip
rm master.zip
cp --verbose --recursive ./asterisk-codec2*/* ./
patch -p0 <./codec2.patch
patch -p0 <./build_codec2.patch

Run the bootstrap script to re-generate configure:

./bootstrap.sh

Configure your patched Asterisk:

./configure

Compile and install:

make
sudo make install

Testing

You can test Codec 2 with CSipSimple plus it’s Codec Pack.

Thanks goes to