Transcoder FAQ
- While the wiki calls out ilbc/g721 ... as being supported, that codec does not appear in Asterisk list of translators. ?
- When using the transcoder why do I hear no audio?
- How do I configure the transcoder when Asterisk/freeSWITCH is located on another server?
- Why does Asterisk crash and exit during load time when using the transcoder?
- Why does Asterisk stop responding shortly after loading?
- How do I configure my routing information when I'm using Asterisk/FreeSWITCH in a remote server?
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.
http://wiki.sangoma.com/Wanpipe-Transcoding#sng_asterisk_usage
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:
CLI> sangoma show rtp statistics
->FreeSWITCH users:
CLI> sangoma_codec stats <session number>
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:
/etc/asterisk/sangoma_codec.conf
->FreeSWITCH users:
/usr/local/freeswitch/conf/autoload_configs/sangoma_codec.conf.xml
In the file add the following line:
-> rtpip= <network interface chosen for transcoder> (i.e. 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
If you have more than 1 vocallo transcoder in your local system, please contact sangoma attechdesk@sangoma.com
3. How do I configure the transcoder when Asterisk/freeSWITCH is located on another server?
If Asterisk/freeSWITCH is located on a remote server than the transcoder, it is important to understand that it will act as a soap server client to the transcoder. That being said, only the soap server (sngtc_server) will be installed on the server containing the transcoder module, and codec installation only on the Asterisk/freeSWITCH system. When Asterisk/FreeSWITCH requires a transcoding session, it will send an HTTP request to the remote server, then the sngtc_server will create transcoding sessions with the local transcoding module. It is important that the sngtc_server is listening on the correct network interface in order to receive these requests before being able to send them to the vocallo module for transcoding. By default, the sngtc_server uses a private local IP/port configuration for local installation, however, this information must be changed in order for the sngtc server to reach the remote soap clients for a distributed system.
After configuring the transcoder module using sngtc_cfg --server (on the server containing the D100) edit the file:
-> /etc/sngtc/sngtc_server.conf.xml
The IP/Port information specified in this file is where the sngtc_server is listening for the HTTP transcoding requests from the remote Asterisk/freeSWITCH client.
Add the following lines of code to the beginning of this file to allow the sngtc_server to listen to all network interfaces:
<settings>
<param name="bindaddr" value="0.0.0.0" />
<param name="bindport" value="9000" />
</settings>
If you want the sngtc_server to listen to specific network interfaces change the "bindaddr" value to the specific interface IP
On the Asterisk/freeSWITCH system, install the sangoma codec outlined here:
http://wiki.sangoma.com/sangoma-media-transcoding#asterisk_install for Asterisk
http://wiki.sangoma.com/sangoma-media-transcoding#freeswitch_install for freeSWITCH
Then make sure to edit the following file to indicate the location of the remote soap server:
For freeSWITCH:
-> sangoma_codec.conf.xml located in /usr/local/freeswitch/conf/autoload_configs/
and add the following lines:
-> <param name="soapserver" value="ethernet interface IP:Port of remote transcoder"/>
-> <param name="rtpip" value="freeSWITCH network interface"/>
*Note: you must run sngtc_cfg --freeswitch in order to generate sangoma_codec.conf.xml
The http address and port specified above will allow the remote soap server to listen for HTTP from FreeSWITCH. You must match with the IP/port info in /etc/sngtc/sngtc_server.conf.xml located on the remote server.
The rtpip value indicates where the return data of the transcoding session should return to
For Asterisk:
-> sangoma_codec.conf located in /etc/asterisk/
add the following lines:
-> soapserver= ethernet interface IP:Port of remote transcoder
-> rtpip= Asterisk network interface
*Note: you must run sngtc_cfg --asterisk in order to generate sangoma_codec.conf
The http address and port specified above will allow the remote soap server to listen for HTTP from Asterisk. You must match with the IP/port info in /etc/sngtc/sngtc_server.conf.xml located on the remote server.
The rtpip value indicates where the return data of the transcoding session should return to
*Do not forget to restart the soap server after all changes to the configurations by typing:sngtc_server_ctrl restart
4. 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.
All Asterisk codecs are located in:
-> /usr/lib/asterisk/modules
In order to do this edit:
-> modules.conf located in /etc/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
5. 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:
-> netstat -npl
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:
-> /sbin/iptables -L
To clear all entries in the firewall run:
-> /sbin/iptables --flush , then run /sbin/iptables -L once more to confirm all firewall entries are cleared
Then restart Asterisk to determine if the issue is resolved
6.How do I configure my routing information when I'm using Asterisk/FreeSWITCH in a remote server?
You may come across an issue where packets will not reach their intended destination because the system might not be setup for IP forwarding or have routes properly defined. For the purpose of this topic, Host A will represent the system with Asterisk/FreeSWITCH and Host B will represent the system containing only the D100 card and sngtc_server.
- First, confirm that you have followed the installation and configuration steps found here:
-> http://wiki.sangoma.com/media-transcoding-faq#multiple_server - Next, make sure that IP forwarding is enabled on Host B. The transcoded rtp stream leaving the vocallo module must be able to route back to the Asterisk/FreeSWITCH client located on the remote system with value rtpip. Enabling this option will allow the rtp to be forwarded by the ethernet device located on the D100 (ex. 10.1.1.1), which will then be routed through the system's routing table. If this option is disabled, the packets will be dropped as soon as they reach the ethernet device on the D100 which will result in no audio.
To check if IP forwarding is enabled on your system, type the following command in the Linux CLI:
-> cat /proc/sys/net/ipv4/ip_forward
The output will either return a '0' or a '1', which indicates the option is disabled or enabled respectively
If you need to enable IP forwarding, edit /etc/sysctl.conf:
-> vi /etc/sysctl.conf, and add the following line:
-> net.ipv4.ip_forward = 1 , or if this line is already present, then make sure the value =1
run the following command to enable changes:
-> sysctl -p /etc/sysctl.conf,
or
-> service network restart on Redhat distributions
->/etc/init.d/procps.sh restart on Debiun/Ubuntu distributions - When Host A requires a transcoding session from the remote D100, it will require to know how to route to the vocallo module (ex. 10.1.1.151 on remote system). Since the vocallo module IP is unknown to Host A, a route must be added in the system's routing table. To add a route to the routing table in Host A, type the following in the Linux CLI:
-> route add -net 10.1.1.0 netmask 255.255.255.0 gw <IP of Host B> dev <ethX> , where ethX represents the ethernet device of Host A's main LAN
Multiple routes can be added if you have multiple connections to the network and want more than one possible access point for transcoding requests. Simply add a new route with the ethX of the next ethernet interface to configure
A route in Host B's routing table will NOT be required because when the returning transcoded RTP stream from the vocallo cannot find its destination through the routing table (i.e. rtpip=HostA) it will route to Host B's default gateway, which will know about Host A and send the stream back to Host A.
* If you are certain that your default gateway does not know about Host A, then you will require to add a route:
-> route add -net <first 3 octets of Host A. 0> netmask 255.255.255.0 gw <gateway> dev <ethX> ,where ethX represents the ethernet device of Host B's main LAN