How to setup g723.1/g729 with Asterisk/Trixbox 1.2.3
for more info see:
http://www.readytechnology.co.uk/open/ipp-codecs-g729-g723.1/
required dependancies:
patchutils, asterisk-devel
required files:
http://www.readytechnology.co.uk/open/ipp-codecs-g729-g723.1/ipp-svn6.diff
ftp://download.intel.com/software/products/ipp/downloads/samples/l_ipp-sample-speech-coding_p_4.1.008.tgz
ftp://download.intel.com/software/products/ipp/downloads/l_ipp_ia32_itanium_p_4_1_2.tar
Step 1
Register with Intel
http://www.intel.com/cd/software/products/asmo-na/eng/perflib/ipp/219858.htm
a) obtain the license number and a license key file
b) put the license key file in the place specified by Intel’s documentation
Step 2
Install IPP libraries.
mkdir /tmp/ipp-tmp
cd /tmp/ipp-tmp
tar xf /tmp/l_ipp_ia32_itanium_p_4_1_2.tar
cd /tmp/ipp-tmp/ipp_ia32_itanium
./install.sh
Follow Intel’s instructions to install IPP.
Intel’s instructions and licensing information (including Open Source
version information) are at http://www.intel.com/software/products/ipp/
Once you’ve installed IPP and agreed to the license terms, you may need to
copy the libraries from one PC to another (eg, from your development machine
to a production server). You just need to copy the contents of the following
directory:
/opt/intel/ipp41/ia32_itanium/sharedlib/
without re-running the install process.
If you use static linking (now the default method), you DON’T need to
copy the libraries onto every computer where you run the codec. You
only need the libraries on the computer where you compile the codec.
Step 3
Install IPP sample code
cd /usr/local/src
tar xzf /tmp/l_ipp-sample-speech-coding_p_4.1.008.tgz
Step 4
Apply patch
cd ipp_sample/
patch -p0 < /tmp/ipp-svn6.diff
Step 5
Select compiler optimizations
cd speech-coding
vi G729-float/Makefile
vi G723.1/Makefile
Note: if you optimize for a more modern process than the processor
in your machine, the codec will not run and Asterisk will not start.
The default is Pentium 4. If you have a Pentium III, you must change
the optimizations.
Step 6
sh ./runme.sh install
If you haven’t used static linking (now the default),
modify /etc/init.d/asterisk:
export
LD_LIBRARY_PATH=/opt/intel/ipp41/ia32_itanium/sharedlib:/opt/intel/ipp41/ia32_itanium/shared
lib/linux32:$LD_LIBRARY_PATH
You may need to insert the following into your
sip.conf, iax.conf, h323.conf, etc:
allow=g729
Now restart Asterisk
/etc/init.d/asterisk restart
Step 7
Verify install
At the shell prompt:
- asterisk -r
At the Asterisk prompt:
>show translation
If the G.723.1 and G.729 columns have -‘s instead of numbers, then
the codecs are not working properly.
==========================
COMMAND LINE ENCODER/DECODER
==========================
G.729 only at present
Do you want to record greetings and IVR messages in G.729 format so
that your CPU doesn’t have to transcode every time a call takes place?
Most likely, yes, you do want this.
Now you can. The original Intel command line encoder and decoder utilities
(g729fpencoder and g729fpdecoder) work with bitstream files in a
special format used by the ITU test suite. This is not the same format
that Asterisk expects when reading/writing raw G.729.
The utilities `my_enc’ and `my_dec’ have been designed to work
with the raw format. Files generated by `my_enc’ can be read by Asterisk
without any transcoding.
Usage:
my_enc audio.raw audio.g729
my_dec audio.g729 audio.raw
Where:
audio.raw must be
– 16 bit signed linear audio,
– mono,
– 8000Hz sample rate
To convert a WAV file into the raw uncompressed audio before feeding it
to `my_enc’, you would use the `sox’ utility (available on all Unix systems):
sox audio.wav -t raw -r 8000 -s -w -c 1 audio.raw
To convert a GSM file (such as those distributed with Asterisk), do:
sox audio.gsm -t raw -r 8000 -s -w -c 1 audio.raw