Mod com g729
mod_com_g729 allows you to have the G.729/A audio codec in FreeSWITCH. It supports G.729 and G.729 Annex A (a=fmtp:18 annexb=no).
G.729 is a toll-quality, low-bandwidth audio codec supported by many VoIP providers. The voice quality of a G.729-encoded call is about the same as that of G.711, the codec used for standard PSTN calls. However, the amount of bandwidth needed to carry a G.729 call is much lower than that for a G.711 call. Enterprises using G.729 will make more efficient use of available network bandwidth.
G.729 uses roughly 1/8th of the bandwidth of a G.711 (8 kbit/s vs 64 kbit/s).
The module is packaged separately from the rest of FreeSWITCH.
It can be downloaded from http://files.freeswitch.org/g729
Full installation instructions are available at the above link in the INSTALL.txt file.
Note: You should make sure that mod_g729 is not loaded at the same time as mod_com_g729.
Download the fsg729-xxx-installer file, make it executable and run it. This will install the module and supporting software to /usr/local/freeswitch or /opt/freeswitch (autodetected). If you are not using one of these directories for FreeSWITCH installation (e.g. using standard Debian directory layout), then you will need to pass two command line parameters:
./fsg729-xxx-installer [bin_dir modules_dir]
./fsg729-194-installer /usr/bin /usr/lib/freeswitch/mod
Your /bin directory will then contain an executable named validator, run this to enter your sales codes (see Licensing) and download your licences.zip file. This file contains your licences which should be extracted to /etc/freeswitch.
No Hardware Detected
This error will usually happen for one of two reasons.
- You're trying to run inside a VM
- Using mod_com_g729 from within a VM is not supported, please use bare metal only
- Your network interfaces aren't named ethX (e.g. eth0, eth1, etc).
- Currently, we only support interfaces named with the ethX scheme. Please change the interface name accordingly.
Licences can be purchased from the FreeSWITCH website - see the G.729 tab at the top of the page.
Pricing is $10 per channel.
A single licence provides you with one encoder and one decoder, which is enough for bridging one call.
Licences are only required for channels performing transcoding (for bridging calls a leg uses G.729 and a different leg uses a different codec, and for applications which need to process media). Bridged channels where G.729 is on all legs still use pass-through mode, so that they do not consume a licence.
Licences are linked to a particular server. This is achieved by linking the licence to the MAC address(es) of the server.
Warning: This means that if these MAC addresses change, the licence will no longer be valid for the server and will need to be reissued (or the MAC addresses returned to the previous values).
Adding more licenses whilst Freeswitch is running
Whilst freeswitch is running you are able to add more licenses without stopping calls. To do this purchase the additional licenses and make a note of *all* of your license numbers (new and old). Run the G729a validator program:
Enter each of your license numbers on a new line and finish by entering a blank line. Follow the installation instructions as per the guide to add your license file to freeswitch and confirm that you do wish to overwrite your old license files when asked. Now that you have updated your licenses you need to re-start the license server which is already running. Kill the process for freeswitch_licence_server and it should automatically restart as soon as a call requests to use g729a. If the license server does not automatically restart itself you can manually start it by issuing this command:
Removed in FreeSWITCH G729 release 147. Use g729_info instead.
This command verifies your license is active and shows you the number of licences available/in use.
freeswitch@internal> g729_info Permitted G.729 channels: 1 Encoders in use: 0 Decoders in use: 0
Returns the number of permitted channels that are licensed on this system
Returns 'true' if the codec is loaded and the license server is available, otherwise returns false.
Returns the encoder:decoder counts. Can be paired with the regex API to do powerful manipulations.
The freeswitch_licence_server is automatically started by mod_com_g729 but if you started freeswitch with a user other than root, e.g. nobody, you have to start freeswitch_licence_server before loading mod_com_g729. Freeswitch will try to automatically start this server however if the user you are running freeswitch as cannot execute /usr/sbin/freeswitch_licence_server it will fail. Give them permission and freeswitch should be able to auto start it.
root#cd /usr/sbin root#./freeswitch_licence_server
If you are running freeswitch with a different user and you add more G729 licenses, stop and start the freeswitch_license_server.
Saving Config Files
After activating, you should keep your zip files around for backups. There's a maximum of 3 activates per license. If you don't read this until it's too late, then you can send an email to firstname.lastname@example.org to have it reset once so that you can back up the files to use in the future.
Phone wants G729A
You're probably seeing something like:
2011-03-17 11:51:06.327987 [DEBUG] sofia_glue.c:4619 Audio Codec Compare [G729a:18:8000:30:8000]/[G729:18:8000:20:8000] 2011-03-17 11:51:06.327987 [DEBUG] sofia_glue.c:4619 Audio Codec Compare [G729a:18:8000:30:8000]/[G722:9:8000:20:64000] 2011-03-17 11:51:06.327987 [DEBUG] sofia_glue.c:4619 Audio Codec Compare [G729a:18:8000:30:8000]/[PCMU:0:8000:20:64000] 2011-03-17 11:51:06.327987 [DEBUG] sofia_glue.c:4619 Audio Codec Compare [G729a:18:8000:30:8000]/[PCMA:8:8000:20:64000] 2011-03-17 11:51:06.327987 [DEBUG] sofia_glue.c:4619 Audio Codec Compare [G729a:18:8000:30:8000]/[GSM:3:8000:20:13200] 2011-03-17 11:51:06.327987 [DEBUG] sofia_glue.c:4619 Audio Codec Compare [PCMU:0:8000:30:64000]/[G729:18:8000:20:8000] 2011-03-17 11:51:06.327987 [DEBUG] sofia_glue.c:4619 Audio Codec Compare [PCMU:0:8000:30:64000]/[G722:9:8000:20:64000] 2011-03-17 11:51:06.327987 [DEBUG] sofia_glue.c:4619 Audio Codec Compare [PCMU:0:8000:30:64000]/[PCMU:0:8000:20:64000] 2011-03-17 11:51:06.327987 [DEBUG] sofia_glue.c:4619 Audio Codec Compare [PCMU:0:8000:30:64000]/[PCMA:8:8000:20:64000] 2011-03-17 11:51:06.327987 [DEBUG] sofia_glue.c:4619 Audio Codec Compare [PCMU:0:8000:30:64000]/[GSM:3:8000:20:13200] 2011-03-17 11:51:06.327987 [DEBUG] sofia_glue.c:4672 Substituting codec PCMU@30i@8000h
On Linksys (or Cisco SPA5XX) phones & ATAs you have to rename the G729 codec name on SIP tab from G729a to G729.