WELCOME [ Log In · Register ]        SITE [ Search · Page Index · Recent Changes ]    RSS

Media Transcoding

d100-transcoding-card.png

  1. Introduction
  2. Sangoma Transcoding Release Download and Extract
  3. D100 Ethernet Installation & IP Configuration
  4. Sangoma Transcoding Release Installation
  5. Asterisk Sangoma Codec Module Install
  6. FreeSWITCH Sangoma Codec Module Install
  7. D100 Transcoding Card Auto Configuration
  8. Asterisk Transcoding Operation
  9. FreeSWITCH Transcoding Operation 

 


Introduction

The D100 Series cards are the industry's first high density affordable PCI or PCI Express voice transcoding cards designed for optimum voice quality for low to high density systems, offering from 30 to 400 transcoding sessions (2-legged calls) in one compact 2U form factor!

 

  • D100 PCI/PCIe card is ethernet based.
    D100 PCIe: system will recognize it as a Broadcom ethernet device.
                      --> Linux: Broadcom driver tg3
    D100 PCI:   system will recognize it as a Micrel ethernet device.
                      --> Linux: Micrel driver ks8842_pci
     
  • D100 PCI/PCIe transcoding card has been designed with a general SNGTC API interface that can be used to develop transcoding applications.
    All media to and from the D100 card will be carried via RTP/IP.
     
  • D100 PCI/PCIe can work with Asterisk & FreeSWITCH as a codec module.
     
  • D100 Supports the following codecs (G729 is fully indemnified- no need to pay extra):

    Codec P time (ms)   Codec P time (ms)
    G711 ulaw
    10,20,30,40ms   G722   20ms
    G711 alaw  10,20,30,40ms   GSM-FR 20ms
    L16  linear
    10,20,30,40ms   GSM-EFR 20ms
    G729 AB 10,20,30,40ms   ILBC  20, 40ms

                          
                           

     

 

 

 

 


Sangoma Media Transcoding Package Installation

 

  1. Download the Latest Sangoma Media Transcoding Release: 
    ---> sng-tc-linux-x86-1.1.3.tgz                     (2010-08-30)             ChangeLog
    ---> sng-tc-linux-x86_64-1.1.3.tgz               (2010-08-30)

     
  2. Untar the release in arbitrary directory
    ---> tar xfz sng-tc-<ver>.tgz

  3. Release Contents

    server/eth_drivers/  Broadcom and Micrel Ethernet drivers.  In case kernel does not have support for above mentioned Ethernet hardware.
    server/libsngtc/
    Sangoma transcoding (SNGTC API) library
    server/sngtc_cfg/ Configuration utility
    server/libsngtc_node Sangoma transcoding node library (SOAP API)
    server/sngtc_server Sangoma transcoding SOAP server
    client/codec Asterisk codec module (Works as a SOAP client)

      
                  



 

 

 


Hardware & Ethernet Driver Installation & Configuration

 

  1. Insert the D100 PCI/PCIe card into the system PCI slot and boot your Linux system.
     
  2. Depending on your kernel:
    --> The Broadcom or Micrel kernel ethernet driver will automatically load and
          additional ethernet device will appear in:
          --> cat /proc/net/dev

    --> The kernel does not support Broadcom or Micrel drivers.
         Drivers will have to be compiled and installed manually.
        
  3. Broadcom/Micrel Driver Detection,  Compilation and Installation
    Run this step only if kernel does not support above Ethernet drivers.
    --> cd sng-tc-<ver>/server/eth_driver

    --> ./install.sh
           The install script will auto detect Boradcom & Micrel support.
           If drivers are not found it will try to build them for the currently running kernel.
      
    The build steps below will be automatically executed by the install.sh script.    
    --
           For Broadcom                                    For Micrel
           --> cd tg3                                            --> cd   ks8842_pci
           --> make                                             --> make
           --> make install                                 --> make install
    --
    --
  4. Detecting kernel Broadcom & Micrel eth drivers for D100 PCIe card

    Note: that this step will also be covered by the install.sh script. 
    The information here is presented for FYI purposes.


    Broadcom driver (tg3) detection in available driver list
    ->  modprobe -l  | grep tg3

    If Broadcom driver exists it should have loaded on boot up.
    -> lsmod | grep tg3

    If Broadcom driver is loaded then we can proceed to configure the ethX device

    Load Broadcom driver into the kernel
    -> modprobe tg3                    (load tg3 driver)
    -> lsmod | grep tg3                (confirm tg3 driver is in loaded list)
    -> tail -f /var/log/messages   (confirm tg3 driver has loaded without any errors)
    -> cat /proc/net/dev            (confirm new eth device is available)

    Micrel driver (tg3) detection in available driver list
    ->  modprobe -l  | grep ks8842_pci

    If Micrel driver exists it should have loaded on boot up.

    -> lsmod | grep ks8842_pci

    If Micrel driver is loaded then we can proceed to configure the ethX device


    Load Micrel driver into the kernel

    -> modprobe ks8842_pci        (load ks8842_pci driver)
    -> lsmod | grep ks8842_pci    (confirm ks8842_pci driver is in loaded list)
    -> tail -f /var/log/messages   (confirm ks8842_pci driver has loaded )
    -> cat /proc/net/dev            (confirm new eth device is available)




  5. Configuring ethernet devices and assigning IP addresses

    Note that this step is very much distro-dependent.

    RedHat/Fedora/CentOS
    --> run: system-config-network
    --> Select new eth device created on eth driver module load
    --> Specify a private IP address that is on different subnet than your local LAN.          
          eg: 10.1.1.1  netmask 255.255.255.0  
    --> Leave gateway ip empty

    To apply network settings run:
    --> /etc/init.d/network restart

    If there are more than one D100 devices in the machine. Each D100 eth device must have its own subnet IP.
    Eg: D100 card1 - IP 10.1.1.1/24
          D100 card2 - IP 10.1.2.1/24

       

Sangoma Transcode Release Installation

 

  1. Install Sangoma Transcoding Library (SNGTC API).
    --
    --> cd sng-tc-<arch>-<ver>
    --> cd server/libsngtc
    --> make
    --> make install

  2. Build and Install Sangoma Transcoding Configuration Utility.
    --
    --> cd sng-tc-<arch>-<ver>
    --> cd server/sngtc_cfg
    --> make && make install
    --
  3. Build Sangoma SOAP node library.

    --> cd sng-tc-<arch>-<ver>
    --> cd server/libsngtc_node
    --> make && make install

  4. Build Sangoma SOAP Server (Note that you need libxml2 and libxml2 headers, ie: yum install libxml2 libxml2-devel)

    --> cd sng-tc-<arch>-<ver>
    --> cd server/sngtc_server
    --> make && make install
    --> make boot

At this point we need to install either Asterisk or FreeSWITCH.


Installing Sangoma Codec module for Asterisk 

In order to perform this steps, you must have Asterisk already installed along with its headers (ie: /usr/include/asterisk/)

  1. cd sng-tc-<arch>-<ver>/client/codec/asterisk
  2. make
  3. make install


FreeSWITCH Sangoma Codec Installation

 

The Sangoma FreeSWITCH codec is part of the FreeSWITCH git repository. You must have FreeSWITCH source code and edit modules.conf to uncomment the line

    # codecs/mod_sangoma_codec

Then compile FreeSWITCH Sangoma codec module:

    1.  make mod_sangoma_codec
    2.  make mod_sangoma_codec-install


Sangoma Transcoding Auto Configuration


This step will auto detect all configured D100 cards and will create Asterisk and/or FreeSWITCH codec module configuration files. The utility used to configure is called "sngtc_cfg".
This utility will probe all the ethernet interfaces looking for transcoding modules. Be aware it will attempt to bring up all interfaces in the system in order to transmit some special ethernet frames
to discover transcoding modules. It will then ask for configuration for each interface where transcoding modules were detected.

  1. Asterisk Sangoma Transcoding Configuration:
    --> sngtc_cfg --server --asterisk
    or
    --> sngtc_cfg --server --asterisk --astdir=/etc/asterisk

    Asterisk Sangoma Transcoding Config file:        
    /etc/asterisk/sangoma_codec.conf
     ---
  2. FreeSWITCH Sangoma Transcoding Configuration:
    --> sngtc_cfg --server --freeswitch  
    or
    --> sngtc_cfg --server --freeswitch  --fsdir=/usr/local/freeswitch/conf/autoload_configs

    FreeSwitch Sangoma Transcoding Config file: 
    /usr/local/freeswitch/conf/autoload_configs/sangoma_codec.conf.xml

 

 


 

Sangoma Transcoding Server Operation


Before using the FreeSWITCH or Asterisk codec module, it is necessary to start the Sangoma transcoding SOAP server. Both, FreeSWITCH and Asterisk codec modules work as SOAP clients for this server, therefore if the server is not started, FreeSWITCH and/or Asterisk won't be able to use the Sangoma transcoding card. This also means you can have multiple FreeSWITCH or Asterisk boxes using the same transcoding card where each box requests transcoding sessions to the box with the card actually installed. In order to start the transcoding server you must use the sngtc_server_ctrl script:

--> sngtc_server_ctrl start

 


Asterisk Sangoma Transcoding Operation

Once the sangoma transcoding configuration file is created by sngtc_cfg configurator we can start Asterisk and load codec_sangoma.so module from the Asterisk CLI.

 Asterisk CLI> module load codec_sangoma.so

An alternative for production systems is add the line load => codec_sangoma.so to Asterisk configuration modules.conf to get the codec module loaded at startup.

At this point the module will read the sangoma_codec.conf configuration and load the configured codec translators. Asterisk will make use of the translators as necesary.

WARNING: There is a bug in Asterisk that may lead to crashes when loading codecs if there are 2 different modules providing the same translation paths. See this bug report for more information:

http://issues.asterisk.org/view.php?id=17092

And also read the sample configuration comments in sng-tc-<version>/codec/asterisk/sangoma_codec.conf.sample to learn more about work-arounds in case you face the problem.

Once the module is loaded Asterisk will use the translation resources when needed. You can see which translators were registered by the Sangoma module using:

Asterisk CLI> sangoma show translators

You can monitor the usage of the translation resources using Asterisk CLI commands:

This command display all the transcoding sessions currently active along with some statistics per session like Tx/Rx packet counters and average Rx/Tx times in milliseconds.

Asterisk CLI> sangoma show transcoding sessions

This command display the lost RTP packets statistics for all sessions.

Asterisk CLI> sangoma show rtp statistics

 


FreeSWITCH Sangoma Transcoding Operation

 

Once the sangoma transcoding configuration file is created by sngtc_cfg configuratior we can start FreeSWITCH and load mod_sangoma_codec.so module from the FS CLI.

 FS CLI> load mod_sangoma_codec

An alternative for production systems is add the line <load module="mod_sangoma_codec"/> to conf/autoload_configs/modules.conf.xml to get the codec module loaded at FS startup.

At this point the module will read the sangoma_codec.conf.xml configuration and load the configured codecs. FreeSWITCH will make use of the codecs as necessary.

You can verify which codecs were registered by the module using the FS native command to list codecs:

FS CLI> show codecs

Several codecs will be listed, all codecs prefixed with "Sangoma" are registered by the module, for example: "Sangoma G729" or "Sangoma G.726 32k".

You can use several commands to monitor the usage of the codecs:

This command will show each vocallo configured settings.

FS CLI> sangoma_codec settings

This command will show all current RTP transcoding sessions created by FreeSWITCH along with some statistics about Rx/Tx and lost RTP packets and read average times that can be used for debugging purposes. The first column show the session unique identifier for the transcoding session, you can use that identifier to query more information about that particular session using "sangoma_codec stats".

FS CLI> sangoma_codec sessions

This command will show the FreeSWITCH RTP statistics in the transcoding sessions. Each transcoding session has a RTP connection associated. You can dump the RTP counters with this command:

FS CLI> sangoma_codec stats <session number>

 

 


 

d100-transcoding-card.png