A day in the life…
G.729
I am embarrassed to say to it took me so long to come to the realization of the importance of codecs with VOIP — I figured that I should stick with the highest bit rate to get the best call quality. Well that is fine and dandy as long as you don’t have a lot of packet loss or have a low bandwidth connection — my setup falls into both of those contexts. So as you can imagine there were times when my VOIP calls were basically inaudible. To make a long story short I was on the phone last night with a network technician from Vonage (troubleshooting some issues with my Dad’s Vonagesystem) and lo-and-behold my network connection started dropping packets like a flower girl at a wedding. After the transmission re-stabilized the Vonage tech gave me a little pointer, he told me to decrease packet size to 10 milliseconds. For whatever reason that turned on the light in my head and it made me realize that I needed to look into compression codecs for my VOIP service.
For a little background on the different VOIP codecs reference THIS.
I was using G.711 — the highest bandwidth, uncompressed audio codec. For a two-way conversation G.711 requires 128 kpbs! After doing some reading / researching I decided that the best bang for the buck is to use the G.729 codec which only requires 8kbps each way. 128kbps vs 16kbps. That is an 88% reduction in bandwidth!! Another bonus to G.729 is the ability to counteract packet loss. But what about sound quality? No one wants tin-can audio, low bandwidth or not. Without trying it out it was hard to say what the end result would be. . .I decided that it was worth a shot. Because G.729 is a proprietary codec it has a licensing fee of $10 per channel. IMHO a one-time fee of $10 per channel is nominal compared to the benefits. Because of my setup and usage patterns I knew that I would need at least two licenses (to allow two concurrent calls).
My SIP server is PBIAF — the following instructions are for G.729 installation on PBIAF.
- Install glibc_2.5 utility — login to the console as root and type “yum install glibc”
- Check to make sure you have a clean install by typing “ld –version”
- Determine your processor type by typing “uname -p”
- Determine your PBIAF 32/64 setup by typing “getconf LONG_BIT”
Remember those settings, we will need them in a minute.
- Go to Digium’s websiteand download the G.729 codec and the Linux registration tool (**NOTE you want to make sure you choose the correct processor and 32/64 architecture type!!!!)
- Unzip the codec and transfer the codec_g729a.so to your PBIAF /usr/lib/asterisk/modules directory and change the ownership of the file to ‘root’ and the permissions to 755
- Place the register script into the /tmp directory and change the permission to ‘a+x’
- Purchase the correct number of licenses from Digium and wait for license keys to be emailed to you.
- From the console type cd into the /tmp directory and then type “./register”
- When prompted enter your license key (**NOTE YOU MUST HAVE WORKING INTERNET CONNECTION FOR THE REGISTRATION PROCESS TO COMPLETE SUCCESSFULLY!!)
- Restart Asterisk by typing “amportal restart“
Now we need to edit your inbound/outbound trunk settings to use the G.729 codec.
- Login to the Administration portal for your PBIAF server
- Go to Setup –> Trunks
- Choose your outbound trunk and in the “PEER DETAILS” section make it say “disallow=all” and then directly underneath it say “allow=g729″ (**NOTE this section is dependant on your service provider — my outbound trunk is through Vitelity)
- Apply Configuration changes
- Choose your inbound trunk and in the “PEER DETAILS” section make it say “disallow=all” and then directly underneath it say “allow=g729″ (**NOTE this section is dependant on your service provider — my inbound trunk is through les.net)
- Apply Configuration changes
Now adjust your phones to use the codec. Each phone will be different, please check your user manual. I have two Grandstream GXP-2000 IP phones that have worked quite well. They support the G.729 codec so all I do to is choose G.729A/B from the audio configuration menu and save the settings.
To confirm that you are using G.729, do the following:
- From the console of your PBIAF server type “asterisk -rvvv”
- From the CLI line type “show g729″
- It should state how many licenses you have and how many encoder/decoders are currently in use.
- Now place a call and type “show g729″ again and this time it should indicate that one of your encoder/decoder is being used.
All in all it was a pretty straightforward configuration and seems to be working great!! Only time will tell how the call quality is with compressed audio and high packet loss. I will keep you posted. For additional information on this tutorial please reference the following links:
http://pbxinaflash.com/forum/showthread.php?p=3370&highlight=configure+codec#post3370
| Print article | This entry was posted by Andy on April 24, 2009 at 11:35, and is filed under Geek. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |





