The speex codec is a freeware compression codec. It can significantly reduce the ammount of bandwidth usage that an asterisk server needs. It also can be used in 'wideband' which means one can get similar audio performance to Skype or Teamspeak. It has good bandwidth performance comparable to some of the more modern codecs in use and there are no licence fees.
To use speex your phone must also support the codec. IAXphone and IDEfisk softphones both support Speex.
Steps to install Speex:
The Speex Codec can be installed in two versions. The stable version is time tested and will produce good bandwidth usage improvements. The development version is considered 'unstable' but has the advantage of being better optimised code (using less CPU), supports 'wideband' audio (better quality audio) and other audio improvements for the same bandwidth.
The stable version of speex can be installed through yum:
yum -y install speex
The development branch needs to be installed from source. The benfits of this might not be worth the effort as both ends of the conversation need to use the development branch to gain the best improvement in audio. However the CPU benefits will be felt on the asterisk server.
The development branch can be installed as follows:
Make sure some initial packages are installed:
yum install automake gcc-c++ autoconf libtool libogg-devel
Get the source:
cd /usr/src
wget http://downloads.us.xiph.org/releases/speex/speex-1.1.12.tar.gz
tar -zxvf speex-1.1.12.tar.gz
mv speex-1.1.12 speex
Compile:
cd speex
./configure
make
make install
We need to create the speex module for asterisk:
Get the asterisk source code for the version you have installed. Use this --> http://www.trixbox.org/modules/newbb/viewtopic.php?topic_id=1359&forum=7
cd /usr/src/asterisk
make
The compile process will see the speex codec installed and will build the asterisk speex module.
We don't want to disturb our existing install too much so we just copy the module to asterisk lib directory.
cp codecs/codec_speex.so /usr/lib/asterisk/modules
Speex has to be enabled for asterisk to use the codec. edit the iax.conf and the sip.conf files in /etc/asterisk and add the allow = speex line.
Various speex settings can be changed in the /etc/asterisk/codec.conf file. This is especially important if you have decided to use the development version. Things like a better version of Voice Activity Detection and a preprocessor can be switched on. For the stable version of Speex you can leave the settings as they are.
Hope this is fun for someone to try. Post back with your experiences.
Rehan
Member Since:
2006-06-02