Installing Digium g.729 codec for Asterisk on an OpenVZ VPS

Installing Digium’s g.729 codec for Asterisk on an OpenVZ VPS requires an Asterisk friendly VPS provider. This is because the installation routine relies on there being an ‘eth0′ device on the server. This is not normally the case with OpenVZ where the network device is called venet0.

An ‘eth0′ device can be created on the VPS by running the following command (this is done on the OpenVZ server) -
(see here for more information – http://wiki.openvz.org/Asterisk_G729)

vzctl set $VEID --netif_add eth0 --save

replacing $VEID with the VPS ID. This doesn’t rename the venet0 device but creates a virtual eth0 device enabling the registration procedure to work

The following is all done on the VPS. The procedure and file names will vary depending on the architecture of the VPS server.

Download and run the Digium register tool -

cd /usr/src
wget http://downloads.digium.com/pub/register/linux/register
chmod 700 register

./register

Follow the menu options and select the G.729 codec entering all of your details.

Download the benchmarking tool. This will run tests on your system and recommend which binary you should download -

wget http://downloads.digium.com/pub/telephony/codec_g729/benchg729/x86-32/benchg729-1.0.7-x86_32
chmod 700 benchg729-1.0.7-x86_32
./benchg729-1.0.7-x86_32

These were my results -

Recommended flavor for this system is 'pentium3m' with an average of 396 milliseconds of CPU time.

Download the recommended binary and copy it to the correct location -

wget http://downloads.digium.com/pub/telephony/codec_g729/asterisk-1.4/x86-32/codec_g729a-1.4_3.1.2-pentium3m_32.tar.gz
tar xvfz codec_g729a-1.4_3.1.2-pentium3m_32.tar.gz
cp codec_g729a-1.4_3.1.2-pentium3m_32/codec_g729a.so /usr/lib/asterisk/modules/

Now restart Asterisk (obviously any calls in progress will be dropped!) -

asteirsk -rv
voip*CLI> restart now

Now connect to the Asterisk console again and you should be able to check that your license was successfully installed -

asterisk -rv

voip*CLI> g729 show licenses
0/0 encoders/decoders of 1 licensed channels are currently in use

Licenses Found:
File: G729-2C8XXXXX.lic -- Key: G729-2C8XXXXX -- Host-ID: 5a:1b:07:cf:xx:xx:xx:xx:xx:05:86:ad:74:9d:2e:c7:91:97:xx:xx -- Channels: 1 (Expires: 2029-07-02) (OK)

You can also check which codecs can be translated. Your system can translate between codecs that have a number where the rows/columns meet.

voip*CLI> show translation
Translation times between formats (in milliseconds) for one second of data
Source Format (Rows) Destination Format (Columns)

g723 gsm ulaw alaw g726aal2 adpcm slin lpc10 g729 speex ilbc g726 g722
g723    -   2    2    2        2     2    1     3    8     -   10    2    -
gsm    6   -    2    2        2     2    1     3    8     -   10    2    -
ulaw    6   2    -    1        2     2    1     3    8     -   10    2    -
alaw    6   2    1    -        2     2    1     3    8     -   10    2    -
g726aal2    6   2    2    2        -     2    1     3    8     -   10    1    -
adpcm    6   2    2    2        2     -    1     3    8     -   10    2    -
slin    5   1    1    1        1     1    -     2    7     -    9    1    -
lpc10    6   2    2    2        2     2    1     -    8     -   10    2    -
g729    6   2    2    2        2     2    1     3    -     -   10    2    -
speex    -   -    -    -        -     -    -     -    -     -    -    -    -
ilbc    6   2    2    2        2     2    1     3    8     -    -    2    -
g726    6   2    2    2        1     2    1     3    8     -   10    -    -
g722    -   -    -    -        -     -    -     -    -     -    -    -    -



Related posts:

  1. Limit SMTP connections for OpenVZ VPS
  2. Skype for Asterisk on Sysadminman VPS
  3. Skype for Asterisk pricing details released


One Comment

  1. Peter Briffett:

    If you’re looking for G.729 codecs that work with Asterisk have you tried the new G.729 Howlet from Howler technologies?
    Prices start at £3.99 per channel and you can get 500 transcoded calls on a quad core – takes some beating that….

Leave a comment