Transcode Sangoma Media Gateway (SMG) Installation for Single Server

     


     

    The Sangoma-media-gateway (SMG) release already includes the full transcoding software package installation in binary form.  Do Not install the standalone transcoding release package ontop of SMG as that will corrupt the embedded transcoding software.  

    *Note: If you have mistakenly downloaded and installed the transcoding package with your SMG installation, please click HERE for instruction on how to revert your changes.


    All transcoding binary files are located in:

    -> /usr/local/smg/usr/bin
    -> /usr/local/smg/usr/sbin 

    The following chart describes each binary application:

    Application Name Description
    sngtc_cfg configuration utility for the transcoding module and client (SMG)
    sngtc_server transcoding SOAP server
    sngtc_server_ctrl command line {start|stop|restart} script for the sngtc_server
    sngtc_tool utility used to probe transcoding module for information
    sngtc_client test application used to create transcoding sessions 

     

    All the above applications are executables located in /usr/local/smg/usr/sbin, except for sngtc_client which is located at /usr/local/smg/usr/bin.  Click HERE for information regarding operation.

     



    Hardware & Ethernet Driver Installation & Configuration 

     

    1. Insert the transcoder (D100/D500) into the system PCI slot and boot your linux server
      -
    2.  Depending on your kernel, the Broadcom or Micrel Ethernet driver will automatically load (Broadcom for PCIe /Micrel for PCI). You can verify by checking for additional Ethernet devices that may have appeared in:
      -> cat /proc/net/dev
      or
      -> ifconfig

      If the transcoder interface was not detected by the kernel, manual installation of the driver is required.   If this is the case, proceed to step 3, otherwise skip to step 4.
      -
    3. Installing Broadcom/Micrel Driver Manually
      -> cd sangoma-media-gateway-linux-<version>-<arch>/smg/src
      -> ./install.sh

      The install script will auto detect Broadcom & Micrel support.
      If drivers are not found it will try to build them for the currently running kernel.

      The following Build process will automatically execute by the install.sh script


       
    Broadcom (tg3) Micrel (ks8842_pci)
    -> cd tg3 -> ks8842_pci
    -> make -> make
    -> make install -> make install

     

     

     

     


    The following is meant for informational purposes and details the process covered by the install.sh script

    Broadcom (tg3) Micrel (ks8842_pci)
    Driver detection
      -> modprobe –l|grep tg3
    Driver detection
      -> modprobe –l|grep ks8842_pci
    If detected, verify it is loaded
      -> lsmod|grep tg3
    If detected, verify it is loaded
      ->  lsmod|grep ks8842_pci

    If loaded,skip and proceed to configure
    ethX interface

    If loaded, skip and proceed to configure
    ethX interface
    load driver into kernel
        -> modprobe tg3
        -> lsmod | grep tg3
        -> tail –f /var/log/messages
        -> cat /proc/net/dev
    load driver into kernel
       -> modprobe ks8842_pci
       -> lsmod | grep ks8842_pci
       -> tail –f /var/log/messages
       -> cat /proc/net/dev


     

       4.  Configuring Ethernet devices and assigning IP addresses
    The following details steps for redhat/CentOS/Fedora Distro
     
    -> run: system-config-network
        -> Select new ethX device created on eth driver module load
        -> Specify a private IP address that is on a different subnet than your local LAN
             eg: 10.1.1.1  netmask 255.255.255.0
        -> Leave gateway ip empty

    Edit the ethX configuration file to start on system boot:
    -> vi /etc/sysconfig/network-scripts/ifcfg-ethX (replace ‘X’ )
    -> add: ONBOOT=yes

    *Note: this step if very important because if the interface does not come up on system boot or after restart, then the transcoder will not be detected and all your transcoding will fail
    Apply network settings run:
    -
    ->/etc/init.d/network restart
    - 
        5.  As a follow up to Step 4, if you did not run make boot when you initially installed Sangoma Media
             Gateway, then the transcoder server (sngtc_server) will not start on system boot and cause
             transcoding failure.

             You can verify this by checking for the boot script in your runlevel: 

             -> vi /etc/inittab    (verify your runlevel)
             -> runlevel will look similar to id:X:initdefault: (X will be a number representing your runlevel)
             -> cd /etc/rcX.d/    (replace X with your runlevel)
             -> ls                        (search for sngtc_server_ctrl
    )
              
              if you do not see sngtc_server_ctrl then you do not have a boot script for the transcoding server.
              In this case, locate the source directory for your Sangoma Media Gateway install and type:
              ->
    make boot
     
     
             Then repeat the above steps to verify the boot script  



    Sangoma Transcoding Auto Configuration

     

    This step will auto detect all configured transcoding cards (D100/D500) and will create codec module configuration files for SMG.  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

    Sangoma Media Gateway (SMG) Transcoding Configuration: 
    --> sngtc_cfg --server -–freeswitch –fsdir=/usr/local/smg/conf/autoload_configs 
     
    *Note: Remember that SMG is FreeSWITCH at its core

    SMG Transcoding Config file: 
     --> /usr/local/smg/conf/autoload_configs/sangoma_codec.conf.xml


    Codec Configuration

     

    The Sangoma transcoder will perform transcoding for all codecs listed in the codec module configuration file: sangoma_codec.conf.xml.  By default, the codec module is already programmed to perform all codec translations for G729.  If you require only g729 translations you do not need to edit any information in the codec module.

    -> If you require the transcoder to perform translations for multiple codec, edit sangoma_codec.conf.xml and add the translation with the following syntax:

    <param name="register" value="XXXX"/>

    Replace ‘XXXX’ with the codec of your choice.  i.e ‘pcmu’

    The above syntax implies that that the transcoder will perform all translations for the indicated codec.  For example if ‘pcmu’ is registered, the transcoder will perform (pcmu->alaw,  alaw->pcmu, g723->pcmu,  pcmu->g723,  gsm->pcmu, pcmu->gsm…etc).

     

    -> If you decide you do not want the Sangoma Transcoder to transcode specific codecs and allow SMG to perform software translation  use the following syntax:


    <param name="noregister" value="XXXX,YYYY"/>

    Replace ‘XXXX’ and ‘YYYYY’ with the codecs names of your choice

     


     

    SMG Codec Configuration


    Before SMG can start using the Sangoma transcoder, the SMG core (which is FreeSWITCH core) must know about the codecs and be able to accept transcoding requests, otherwise SMG will ignore this unknown request.  This type of information can be edited in:

    ->/usr/local/smg/conf/freeswitch.xml

    Verify that you see the following lines and that the codecs that you want SMG to use is indicated:

    <X-PRE-PROCESS cmd=”set” data=”global_codec_prefs=XXXX,YYYY,AAAA,BBBB”/>
    <X-PRE-PROCESS cmd=”set” data=”outbound_codec_prefs=XXXX,YYYY,AAAA,BBBB”/>

    Replace XXXX,YYYY,AAAA, BBBB with the codec names

    You can also have Sofia inherit the default codecs listed in freeswitch.xml by editing:

    ->/usr/local/smg/conf/autoload_configs/sofia.conf.xml

    And add the following:

    <settings>
     <param name="codec-prefs" value="$${default_codecs}"/>
     <param name="codec-ms" value="20"/>

    </settings>

     


     

    Sangoma Transcoding Server Operation

     

    Before using the SMG codec module, it is necessary to start the Sangoma transcoding SOAP server.  SMG codec modules work as SOAP clients for this server, therefore if the server is not started, SMG won't be able to use the Sangoma transcoding card. This also means you can have multiple SMG boxes using the same transcoder 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

     



    SMG Transcoding Operation

     

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

    SMG CLI> load mod_sangoma_codec

    If you want the codec module to automatically load on SMG start up, edit:

     ->/usr/local/smg/conf/autoload_configs/modules.conf.xml

     

    And uncomment the following line:

    <!-- <load module="mod_sangoma_codec"/> -->

     

    The codec module will read the sangoma_codec.conf.xml configuration and load the configured codecs.  SMG will make use of the codecs as necessary

     

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

    SMG CLIshow 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".

     

    The following three commands are used to monitor the usage of the codecs:

    SMG CLI> sangoma_codec settings

    This command indicates each vocallo configured settings.

    SMG CLI> sangoma_codec sessions

    This command will show all current RTP transcoding sessions created by SMG 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".

    SMG CLI> sangoma_codec stats <session number>

    This command will show the SMG RTP statistics in the transcoding sessions. Each transcoding session has a RTP connection associated.