Installing additional codecs (speex, ilbc, G.722) on Asterisk 1.4 (CentOS)

Asterisk 1.4 supports several FREE and most popular codecs out of the box (G.711, GSM, etc). I didn't really need any additional codecs, but decided to install 3 other popular and FREE codecs (speex, ilbc, G.722)

Installing speex codec

Latest source code has to be obtained from http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz

[bc@truecard src]# yum install libogg, libogg-devel
[bc@truecard src]# wget http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz
[bc@truecard src]# tar -xvf speex-1.2rc1.tar.gz
[bc@truecard src]# cd speex-1.2rc1
[bc@truecard speex-1.2rc1]# ./configure
[bc@truecard speex-1.2rc1]# make
[bc@truecard speex-1.2rc1]# make install

After compiling the codec you have to recompile Asterisk

Installing ilbc codec

To download the source code run standard Asterisk script: /usr/src/asterisk/contrib/scripts/get_ilbc_source.sh

[bc@truecard src]# cp /usr/src/asterisk-1.4.23.1/contrib/scripts/codecs/ilbc /usr/src/asterisk-1.4.23.1/codecs/ilbc

After compiling the codec you have to recompile Asterisk

Edit file /etc/ld.so.conf.d/asterisk.conf You have to add new line (it could be the only line in this file): /usr/local/lib

[bc@truecard src]# ldconfig

Installing G.722 codec

Get patch from http://carlton.oriley.net/drupal/files/asterisk-1.4.7.1-g722.patch

[bc@truecard asterisk-1.4.23.1]# wget http://carlton.oriley.net/drupal/files/asterisk-1.4.7.1-g722.patch
[bc@truecard asterisk-1.4.23.1]# patch -p0 < asterisk-1.4.7.1-g722.patch

After compiling the codec you have to recompile Asterisk

 

It might be a good idea to install all codecs and after that recompile asterisk only once.