Asterisk Up-to-Speed
Codecs - New Features, Upgrades, and Changes
Asterisk 1.4 -> Asterisk 1.6.0 -> Asterisk 1.6.1 -> Asterisk 1.6.2 -> Asterisk 1.8

  1. Codec Ilbc Mode 20
  2. Install Ilbc Codec Asterisk Definition Online
  3. G729 Codec Bandwidth
  4. Install Ilbc Codec Asterisk Definition Windows 10
  5. Install Ilbc Codec Asterisk Definitions

Internet Low Bitrate Codec (iLBC) is a royalty-free narrowband speech audio coding format and an open-source reference implementation (codec), developed by Global IP Solutions (GIPS) formerly Global IP Sound (acquired by Google Inc in 2011). Cd asterisk make clean make menuselect This will bring up a menu selection for Asterisk. Select item #4 Codec Translators. Scroll to codecilbc and check that box. Save (s) the selection and exit. Then do: make This re-compiles Asterisk and will take a little while. When it is done do: make install.

G.719:Asterisk 1.6.2 -> Asterisk 1.8
  1. Step by step guide to install g729 codec of your asterisk pbx, this codec will help you improve voice quality.
  2. The Internet Low Bitrate Codec (iLBC) provides an attractive mix of low bandwidth usage and quality, and it is especially well suited to sustaining reasonable quality on lossy network links. Naturally, Asterisk supports it (and support elsewhere is growing), but it is not as popular as the ITU codecs and, thus, may not be compatible with common.

  • The addition of G.719 pass-through support.RESAMPLE Codec:Asterisk 1.4 -> Asterisk 1.6.0
    • Added a new codec translation module, codec_resample, which re-samples signed linear audio between 8 kHz and 16 kHz to help support wideband codecs.iLBC Codec:
    Asterisk 1.4 -> Asterisk 1.6.0
    • Previously, the Asterisk source code distribution included the iLBC encoder/decoder source code, from Global IP Solutions (http://www.gipscorp.com). This code is not licensed for distribution, and thus has been removed from the Asterisk source code distribution. If you wish to use codec_ilbc to support iLBC channels in Asterisk, you can run the contrib/scripts/get_ilbc_source.sh script to download the source and put it in the proper place in the Asterisk build tree. Once that is done you can follow your normal steps of building Asterisk. You will need to run 'menuselect' and enable the iLBC codec in the 'Codec Translators' category.
    ITU G.722.1/G.722.1C:Asterisk 1.6.1 -> Asterisk 1.6.2
    • The Asterisk core now supports ITU G.722.1 and G.722.1C media streams, and can connect calls in passthrough mode, as well as record and play back files.
    Speex:Asterisk 1.6.2 -> Asterisk 1.8
    • Added support for 16khz Speex audio. This can be enabled by using 'allow=speex16' during device configuration.
Skip to end of metadataGo to start of metadata

1. While the wiki calls out iLBC as being supported, that codec does not appear in the list of translators?

You will have to enable iLBC in the Asterisk Sangoma codec configuration file.
Asterisk has bug that if you try to register 2 of the same codec it will crash :)
For that reason we are very careful as to what we include automatically.
You will have to edit the asterisk sangoma config file and enable iLBC (register=ilbc).

The same apply for any codec other than G729, by default only G729 is enabled in Asterisk and FreeSWITCH.

2. When using the transcoder why do I hear no audio?

If you are hearing no audio during calls when the transcoder is being used, use the following command to determine if Asterisk/FreeSWITCH is processing Tx and Rx packets with the transcoder:

->Asterisk users:

->FreeSWITCH users:

If only the Rx packets are not incrementing, this means that the Tx packets are being sent to the transcoder, but the processed packets are not being returned back to Asterisk/FreeSWITCH. This scenario occurs when the Vocallo module inside the transcoder cannot find a real IP address for Asterisk/FreesWITCH in which to return the Rx packets to, and uses the local host address 127.0.0.1. The result is Rx packets being looped back to the vocallo module. To verify the local host address of your system ping $(HOSTNAME).

If the local host address of your system is 127.0.0.1, this issue can be resolved simply by editing the file:

->Asterisk users:

->FreeSWITCH users:

->Asterisk Users:

In the file add the following line:

-> rtpip= <network interface chosen for transcoder> (i.e. rtpip=10.1.1.1)

This will send the Rx packets up to the network interface of the transcoder, then Asterisk/FreeSWITCH will be able to receive the packets.

The final step is to reload the sangoma codec module in the CLI

->FreeSWITCH users:

In the file add the following line:

-> <param name='rtpip' value='10.1.1.1'/>

This line needs to be added in the <settings> tag of the xml file. See below for an example config.


3. Why does Asterisk crash during load time when using the transcoder?

If Asterisk encounters a codec being registered with a lower cost than one that already exists, it will crash with segmentation fault. This scenario occurs due to a bug in Asterisk, with more information provided here: http://issues.asterisk.org/view.php?id=17092.

The sangoma translator module is designed to prevent such an issue, only if it loads AFTER asterisk codec translators. Make sure that 'codec_sangoma.so' located in /usr/lib/asterisk/modules/ loads after all other codecs in that directory.

However, an easier way to resolve this issue, is to have Asterisk never load the translation paths that will be provided by the sangoma translator.

Codec Ilbc Mode 20

All Asterisk codecs are located in:

In order to do this edit:

Asterisk

and create 'noload' lines for all asterisk translator paths. (i.e. noload=>codec_g722.so)

Once Asterisk is restarted, in the CLI, you can type 'module show like codec' to view all other codecs loaded by asterisk


4. Why does Asterisk stop responding shortly after loading?

If Asterisk stops responding shortly after loading, it could be an issue with the firewall settings on your system. By default, the sngtc server is configured to listen on all network interfaces, however if you decide to specify the interface for the sngtc server, then the firewall must allow for communication between the sngtc server and the client (Asterisk/FreeSWITCH).

To check how the sngtc server is configured, run:

If you have not changed the default configuration, then the output of the above command should indicate that the sngtc_server is listening on 0.0.0.0. If the sngtc server is listening on another port, then make sure that port is allowed through the firewall.

If the issue persists after checking the above, the firewall might still be causing the issue, at which point, all firewall entries should be cleared. To check all firewall entries run:

To clear all entries in the firewall run:

then run

once more to confirm all firewall entries are cleared

Then restart Asterisk to determine if the issue is resolved

5. After installing the D100 PCI express card, I get NMI debug messages on my system

After installing the D100 PCIe card, if you notice system debug messages that say: 'Uhhuh. NMI received. Dazed and confused, but trying to continue', this is due to parity error. To resolve this issue, simply download and install the latest tg3 broadcom ethernet driver found here: tg3-3.112d.tar.gz

Reboot the system after the install

6.Why can't I start asterisk after setting up the Transcoder?

After installing the transcoder, asterisk may fail to load. After checking the asterisk logs (/var/log/asterisk/messages) you see the following messages:

ERROR[8124] res_config_ldap.c: No directory URL or host found
ERROR[8124] res_config_ldap.c: Cannot load LDAP RealTime driver.
ERROR[8124] codec_sangoma.c: Refusing to load this module with non-dahdi timing, please disable all res_timing_*.so modules and leave res_timing_dahdi.so as the only timing source in modules.conf
ERROR[8124] codec_sangoma.c: You can load this module with other timing sources by setting allownondahditiming=yes in sangoma_codec.conf general configuration section

To resolve this issue, follow either of the following two steps:

  1. Edit modules.conf (typically located in /etc/asterisk/) and either comment out or create 'noload=>' entries for all res_timing_*.so modules, accept for res_timing_dahdi.so.
  2. Edit sangoma_codec.conf (typically located in /etc/asterisk/) and create an entry 'allownondahditiming=yes'

Then asterisk should load properly and all the codecs registered by the transcoder will begin to load

7. Why does the output of 'core show translation' in the Asterisk CLI indicate 999999 for the particular codecs I have enabled through the Sangoma transcoder?

If the output of 'core show translation' in the Asterisk CLI indicates '999999' for all transcoding paths responsible by the Sangoma transcoder then the sngtc_server is not running.

Install Ilbc Codec Asterisk Definition Online

You will also notice messages in the asterisk logs (/var/log/asterisk/messages):

ERROR[8269] codec_sangoma.c: Failed to create Sangoma transcoding session
WARNING[8269] translate.c: Translator 'sngalawtog729' appears to be broken and will probably fail.
ERROR[8269] codec_sangoma.c: Create Transcoding Session Error

To resolve this issue simply turn on the sngtc_server by typing the following in the Linux CLI:

-> sngtc_server_ctrl start

Then either reload codec_sangoma.so or restart Asterisk

8.Why does the 'sngtc_cfg --server' fail during configuration?

Asterisk

running: 'sngtc_cfg --server' may result in the following messages:

[SNGTC_INFO ] Configuring Sangoma Transcoding Server
[SNGTC_INFO ] Configuring Sangoma Transcoding for Asterisk
[SNGTC_INFO ][SNGTC_INFO ][SNGTC_INFO ] Detecting Transcoding Card & Modules ...
[SNGTC_ERROR] sngtc_cfg: Failed to detect transcoding modules!

If the above messages appear, then the reason could be the following:

The system does not recognize the Sangoma transcoder as an Ethernet device, run:

and make sure the proper network driver is loaded (broadcom for PCIe or micrel for PCI). If the network driver is not present, please follow the network driver installation procedure.
The Ethernet interface for the Sangoma transcoder is not up. This can easily be verified by running the command:

If the Ethernet device is not present, type the command:

and located the Ethernet interface in question and then run:

(where X represents the Ethernet interface)

The Ethernet device corresponding to the Sangoma Transcoder does not have an IP address programmed. This can be easily verified by running the command:


(where X represents the interface brought up by the transcoder)
Program an IP address for the transcoder and re-run 'sngtc_cfg --server'

9. Why does 'core show translation' in Asterisk indicate very high values for the sangoma codecs?

Codec ilbc mode 20

The cost values for the sangoma codecs in 'core show translations' will be very high compared to the asterisk codecs by design. When a Sangoma codec is registered, asterisk will be forced to use the Sangoma codec if a translation is required by that path, since only unique codec paths can be registered in asterisk. However, it is important that the Sangoma codecs are only used when a translation is required by that codec, and not used as an intermediate step for a translation for a separate codec. In order to implement this stipulation, the Sangoma codecs are registered with higher cost values relative to the loaded asterisk codecs, so that when a non-sangoma codec translation is required Asterisk will directly choose the asterisk codec and will not attempt to intermediately use a sangoma codec (the path of least resistance).

Asterisk

10.How can I test the transcoder?

Testing the transcoder is easy. Ensure it is configured first as shown in the installation steps. Next simply copy and past the commands below onto your system and this will download a GSM file from our FTP then convert this to g729. Once the file is in g729 it will then be converted back to a wav file you can download and listen to.

  • Note 10.1.1.1 is the IP address of the transcoders network interface. If your IP is different replace 10.1.1.1 with the IP of your transcoder before pasting the commands into the Linux cli.
  • The output wav file will be called 'demo-congrats-transcoded.wav'.

Commands To Paste into Linux cli:

11. How to get a core dump of the transcoder

You only need to run the -getcore if you cannot ping/access the vocallo module. If you can ping and run at least 1 transcoding session (i.e. with sngtc_client) you will not get a core output.
1. Stop Asterisk and/or FreeSWITCH or anything else using the card.

2. Stop the sngtc server.

3. ifconfig ethx down && ifconfig ethx up

G729 Codec Bandwidth

4. Run sngtc_tool with the -getcore option and save the core if any.

If you get the following, this means no core was generated from the vocallo:
[07:09:24:162] [SNGTC_ERROR] Failed to write core from module 1, this could mean there is no core file to read.


5. Start a pcap trace in the ethernet interface of the transcoding card. Make sure to provide the -s 0 option to not truncate packets and DO NOT capture udp packets (we're not interested in the RTP).

Asterisk


Change ethX to the interface in question. If you are using a D100 locally, this would be the Eth interface of the transcoder from 'ifconfig'
If using a D150 or transcoder is remote, use Eth connected to the lan (i.e. Eth0)

Change X.X.X.X to the IP address representing what you select to replace ethX

i.e. (D100 locally):

i.e. (D150):

6. Start the sngtc server and Asterisk/FreeSWITCH.

7. Reproduce the problem until the octasic errors are thrown or the card become unresponsive.

8. Stop Asterisk and/or FreeSWITCH or anything else using the card.

Install Ilbc Codec Asterisk Definition Windows 10

9. Stop the sngtc server.

10. Stop the pcap trace.

Install Ilbc Codec Asterisk Definitions

11. ifconfig ethx down && ifconfig ethx up

12. Run sngtc_tool with the -getcore option and check if a core was generated and save it if that's the case.