Compile G729 for Asterisk from binaries


Asterisk


Table of contents:

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.

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

Binaries #

Let’s check our CPU type, Asterisk version

1cat /proc/cpuinfo
2[...]
3asterisk -r // if it runs (or just asterisk if not)
4*CLI> core show version
5Asterisk 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:

1apt-get install mercurial
2hg clone http://bitbucket.org/arkadi/asterisk-g72x
3cd asterisk-g72x/
4./autogen.sh 
5./configure --with-bcg729 --with-asterisk130
6make
7make 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:

1ls /usr/lib/asterisk/modules | grep 729
2codec_g729.so
3format_g729.so
4res_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.

 1asterisk -r
 2*CLI> module load codec_g729.so
 3*CLI> core show translation
 4Translation times between formats (in microseconds) for one second of data
 5Source Format (Rows) Destination Format (Columns)
 6ulaw alaw gsm g726 g726aal2 adpcm slin slin slin slin slin slin slin slin slin lpc10 g729 speex speex speex ilbc g722 testlaw
 7ulaw - 9150 15000 15000 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250 15000
 8alaw 9150 - 15000 15000 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250 15000
 9gsm 15000 15000 - 15000 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250 15000
10g726 15000 15000 15000 - 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250 15000
11g726aal2 15000 15000 15000 15000 - 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250 15000
12adpcm 15000 15000 15000 15000 15000 - 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250 15000
13slin 6000 6000 6000 6000 6000 6000 - 8000 8000 8000 8000 8000 8000 8000 8000 6000 6000 6000 14000 14000 6000 8250 6000
14slin 14500 14500 14500 14500 14500 14500 8500 - 8000 8000 8000 8000 8000 8000 8000 14500 14500 14500 14000 14000 14500 14000 14500
15slin 14500 14500 14500 14500 14500 14500 8500 8500 - 8000 8000 8000 8000 8000 8000 14500 14500 14500 6000 14000 14500 6000 14500
16slin 14500 14500 14500 14500 14500 14500 8500 8500 8500 - 8000 8000 8000 8000 8000 14500 14500 14500 14500 14000 14500 14500 14500
17slin 14500 14500 14500 14500 14500 14500 8500 8500 8500 8500 - 8000 8000 8000 8000 14500 14500 14500 14500 6000 14500 14500 14500
18slin 14500 14500 14500 14500 14500 14500 8500 8500 8500 8500 8500 - 8000 8000 8000 14500 14500 14500 14500 14500 14500 14500 14500
19slin 14500 14500 14500 14500 14500 14500 8500 8500 8500 8500 8500 8500 - 8000 8000 14500 14500 14500 14500 14500 14500 14500 14500
20slin 14500 14500 14500 14500 14500 14500 8500 8500 8500 8500 8500 8500 8500 - 8000 14500 14500 14500 14500 14500 14500 14500 14500
21slin 14500 14500 14500 14500 14500 14500 8500 8500 8500 8500 8500 8500 8500 8500 - 14500 14500 14500 14500 14500 14500 14500 14500
22lpc10 15000 15000 15000 15000 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 - 15000 15000 23000 23000 15000 17250 15000
23g729 15000 15000 15000 15000 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 - 15000 23000 23000 15000 17250 15000
24speex 15000 15000 15000 15000 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 - 23000 23000 15000 17250 15000
25speex 23500 23500 23500 23500 23500 23500 17500 17500 9000 17000 17000 17000 17000 17000 17000 23500 23500 23500 - 23000 23500 15000 23500
26speex 23500 23500 23500 23500 23500 23500 17500 17500 17500 17500 9000 17000 17000 17000 17000 23500 23500 23500 23500 - 23500 23500 23500
27ilbc 15000 15000 15000 15000 15000 15000 9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 - 17250 15000
28g722 15600 15600 15600 15600 15600 15600 9600 17500 9000 17000 17000 17000 17000 17000 17000 15600 15600 15600 15000 23000 15600 - 15600
29testlaw 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!

comments powered by Disqus