Wednesday, June 29, 2011

Install (Free) g729 codec on Trixbox CE (asterisk)

g729 is a low bandwidth codec, which can operates at a lower bandwidth of 8Kb/s. This tutorial describes how to install the g729 free codec on trixbox CE.

Download the Codec

Free version of the g729 codecs are available on http://asterisk.hosting.lv/#bin .

Depending on the architecture and the version of asterisk on your machine, download the correct package from the above site.
For finding the asterisk version and system processor architecture we can use the following commands.

astersik -V
uname -a
I have downloaded the following package which worked fine for my Xeon dual core processor and asterisk version 1.4.
[trixbox ~]# wget http://asterisk.hosting.lv/bin/codec_g729-ast14-gcc4-glibc-core2-sse4.so

Rename the codec file

Rename the downloaded file and copy it to /usr/lib/asterisk/modules directory as follows,
[trixbox ~]# cp codec_g729-ast14-gcc4-glibc-core2-sse4.so /usr/lib/asterisk/modules/codec_g729.so

Reload Asterisk

Load the above copied module, by issuing the following command on asterisk console,
[trixbox ~]# asterisk -r
trixbox*CLI> codec load codec_g729

Check the work

Verify the codec has been loaded correctly by the following command on console,
trixbox*CLI> show translation
you will see a line as below for g729,

g729 - 2 2 2 2 2 1 3 - 9 10 2 -

If everything went well as mentioned above, we can test the codec functionality by enabling it in an extension as below,

Test the codec working

Login to the web interface and go to PBX-> PBX Settings-> Extensions, choose one extension you wish to enable the codec for, ensure disallow is set to “all” and allow is set to “g729”.

Once the extension is set up to allow g729, you can test whether it’s working properly by having a test call connected and running the command sip show channels:

trixbox*CLI> sip show channels
It will list the output as below,

192.168.113.35 3245 eefbd3ee-b5 00101/00001 0x100 (g729) No Rx: ACK
We are done.

Troubleshooting

If you didn’t see the codec translation as mentioned above then probably you downloaded the wrong codec, please check again the points mentioned during downloading the codec