Compile G.729 for Asterisk from binaries

This is quite popular source of binaries for enabling premium G.729 module (codec_g729.so) in Asterisk. Let's enable this module for our recently installed Asterisk v13.

Prerequisites

In order to install this codec we need some prerequisites. Let's get them and install. We can either wget it or clone from git. Does not matter. BCG729 is the lib we need.


cd /usr/src/
wget http://download-mirror.savannah.gnu.org/releases/linphone/plugins/sources/bcg729-1.0.0.tar.gz
tar xzf bcg729-1.0.0.tar.gz
cd bcg729-1.0.0
./configure --libdir=/lib
make
make install

Binaries

Let's check our CPU type, Asterisk version


cat /proc/cpuinfo
[...]
asterisk -r // if it runs (or just asterisk if not)
*CLI> core show version
Asterisk 13.14.0 built by asterisk @ ... 

Now we know a bit about our processor and version of PBX. Let's go here and grab our binary. Here are my steps:


apt-get install mercurial
hg clone http://bitbucket.org/arkadi/asterisk-g72x
cd asterisk-g72x/
./autogen.sh 
./configure --with-bcg729 --with-asterisk130
make
make install

NB! apt-get install mercurial enables Mercurial client for fetching files from bitbucket repository.

Just to verify our steps let's do the following:


ls /usr/lib/asterisk/modules | grep 729
codec_g729.so
format_g729.so
res_format_attr_g729.so

The output of /usr/lib/asterisk/ directory shows us code_g729.so. Great.

Enable G729 for Asterisk

As we have all modules copied to the relevant folders. All we need to do is to enable this module in Asterisk CLI.


asterisk -r
*CLI> module load codec_g729.so
*CLI> core show translation
Translation times between formats (in microseconds) for one second of data
Source Format (Rows) Destination Format (Columns)
ulaw alaw gsm g726 g726aal2 adpcm slin slin slin slin slin slin slin slin slin lpc10 g729 speex speex speex ilbc g722 testlaw
ulaw - 9150 15000 15000 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250 15000
alaw 9150 - 15000 15000 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250 15000
gsm 15000 15000 - 15000 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250 15000
g726 15000 15000 15000 - 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250 15000
g726aal2 15000 15000 15000 15000 - 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250 15000
adpcm 15000 15000 15000 15000 15000 - 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250 15000
slin 6000 6000 6000 6000 6000 6000 - 8000 8000 8000 8000 8000 8000 8000 8000 6000 6000 6000 14000 14000 6000 8250 6000
slin 14500 14500 14500 14500 14500 14500 8500 - 8000 8000 8000 8000 8000 8000 8000 14500 14500 14500 14000 14000 14500 14000 14500
slin 14500 14500 14500 14500 14500 14500 8500 8500 - 8000 8000 8000 8000 8000 8000 14500 14500 14500 6000 14000 14500 6000 14500
slin 14500 14500 14500 14500 14500 14500 8500 8500 8500 - 8000 8000 8000 8000 8000 14500 14500 14500 14500 14000 14500 14500 14500
slin 14500 14500 14500 14500 14500 14500 8500 8500 8500 8500 - 8000 8000 8000 8000 14500 14500 14500 14500 6000 14500 14500 14500
slin 14500 14500 14500 14500 14500 14500 8500 8500 8500 8500 8500 - 8000 8000 8000 14500 14500 14500 14500 14500 14500 14500 14500
slin 14500 14500 14500 14500 14500 14500 8500 8500 8500 8500 8500 8500 - 8000 8000 14500 14500 14500 14500 14500 14500 14500 14500
slin 14500 14500 14500 14500 14500 14500 8500 8500 8500 8500 8500 8500 8500 - 8000 14500 14500 14500 14500 14500 14500 14500 14500
slin 14500 14500 14500 14500 14500 14500 8500 8500 8500 8500 8500 8500 8500 8500 - 14500 14500 14500 14500 14500 14500 14500 14500
lpc10 15000 15000 15000 15000 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 - 15000 15000 23000 23000 15000 17250 15000
g729 15000 15000 15000 15000 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 - 15000 23000 23000 15000 17250 15000
speex 15000 15000 15000 15000 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 - 23000 23000 15000 17250 15000
speex 23500 23500 23500 23500 23500 23500 17500 17500 9000 17000 17000 17000 17000 17000 17000 23500 23500 23500 - 23000 23500 15000 23500
speex 23500 23500 23500 23500 23500 23500 17500 17500 17500 17500 9000 17000 17000 17000 17000 23500 23500 23500 23500 - 23500 23500 23500
ilbc 15000 15000 15000 15000 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 - 17250 15000
g722 15600 15600 15600 15600 15600 15600 9600 17500 9000 17000 17000 17000 17000 17000 17000 15600 15600 15600 15000 23000 15600 - 15600
testlaw 15000 15000 15000 15000 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250 -

You may want to repeat it for G.723!

That's all! Enjoy!


In short, this is about:
#g729
#asterisk

Start discussion:
Related articles:
35 how to install asterisk ip pbx on debian 8 x jessie preview
How to install, configure and run Asterisk 13 on Debian 8.x. From nothing to PBX in 5 minutes! ... more
almost 2 years#pbx #asterisk #debian
36 fail2ban with asterisk 13 preview
This tutorial explains how to install and configure fail2ban for Asterisk 13 IP/PBX. ... more
almost 2 years#fail2ban #asterisk
86 call recording asterisk preview
Asterisk IP PBX comes with embedded MixMonitor, that allows us to to record and place those recordings somewhere. ... more