Sunday, March 4, 2012

Install g729 codec free

The g729 codecs are the most popular codes for VoIP particularly when using a VoIP trunk for a distance calling and you don't have enough bandwidth to make a crystal clear and high definition audio call. 
I will be showing you for the simple way to install the g729 code as free for you Asterisk box but before we proceed please take a note for the following. 

The free g729 codes are only supported in Asterisk for the multiple channels as 'Pass through mode' .
What does it mean ? 
The 'Pass through mode' means that your call originating device & call termination devices must have support for g729. Otherwise it will show you Error codecs translation and you can't play IVR using g729 sound files format and also can not do the call recordings with g729 as recorded file format. If you want to have calling recording or IVR then you must purchase the license for g729 and its per port means per channel more information can be found on Digium website as follow. 

Since we don't need call recording or IVR to be played using g729 codecs format. and we require only to use this for making calls and less consume our bandwidth. 

Following are the steps 
1. Find the processors type of your machine by using the command

 uname -a

cat /proc/cpuinfo

in my case its i386 and CPU is Pentium 4 and then further find your Asterisk version by using Asterisk  -V
and again my version of  asterisk is its fonality compiled means its Trixbox 2.8.

now we have Processor type as i386 and family of Pentium 4 with Asterisk with these information we are going to download the g729 codes for our asterisk box. 

as you can see in the above screen I have selected asterisk 1.6.0 branch and if you further scroll down you will find the following. 

This is what we need right click on it and select the 'copy link address' (Firefox & Chrome) users 
and now go to your CLI terminal and navigate to the following directory. 
using cd command. 

cd /usr/lib/asterisk/modules

and type

and hit enter it will start downloading the codecs. 
after it successfully download issue the command

ls -ltr | grep g729

you will see the files with .so as extension 
check if you have any old version of g729 codes just delete it by using
rm -rf 

Please be care full here there is file name '' (DON'T DELETE THIS ONE)

and now just renamed the downloaded codes as follow


and check again 

ls -ltr | grep g729

you will have 

-rwxrwxrwx 1 root      root      397024 Sep 17  2008
-rwxr-xr-x    1 root      root        7124 Jun  8  2010

its better to allow permission rights on this codec so I am giving full right permission 

chmod 777

and its time to restart the asterisk

/etc/init.d/asterisk restart

Note: If asterisk keep restarting with some strange behavior. Its better to reboot this machine and after rebooting connect to Asterisk CLI using 
Asterisk -r and type core show translation
you will see the g729 codes along with others code as I highlighted in red. If this column and rows shows numeric values means you have install it successfully otherwise repeat all the steps and try again. 

Next use allow g729 codes in your sip.conf and enjoy free this great quality codes for free. Make some calls and you will notice the difference the calls are more clear and audio able then before if you are using g729 for the first time. 

Thanks for reading
Numan Khan
Expert Voice