Sangoma Transcoding Package
===========================

Copyright (C) 2011 Sangoma Technologies

Authors:
	Nenad Corbic <ncorbic@sangoma.com>
	Moises Silva <moy@sangoma.com>
	David Rokhvarg <davidr@sangoma.com>

Installation Instructions
---------------------------

Latest instructions are located at:

---> http://wiki.sangoma.com/sangoma-media-transcoding


Sangoma Media Transcoding

 

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

 
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 card can work with Asterisk & FreeSWITCH as a codec module.
       
    * D100 Supports 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 from the Sangoma wiki: 
      ---> sng-tc-linux-<arch>-<version>.tgz
       
   2. Untar the release in arbitrary directory
      ---> tar xfz sng-tc-linux-<arch>-<version>.tgz

   3. Release Contents

      server/libsngtc/ 		Sangoma transcoding (SNGTC API) library 
      server/sngtc_server/	Sangoma transcoding SOAP Server.
      server/sngtc_tool/	Transcoding server utility (upgrade firmware, licensing etc)
      server/eth_drivers/ 	Broadcom and Micrel Ethernet drivers.  In case kernel does not have support for above mentioned Ethernet hardware.

      client/libsngtc_node/     Sangoma transcoding node (SOAP client API)
      client/codec/ 		Codec modules for Asterisk (works as a SOAP client to the sngtc_server binary)
                                (The FreeSWITCH codec module is included in FreeSWITCH git repository)
      client/sngtc_client/	Stand alone transcoding client

      sngtc_cfg/ 	        Configuration utility

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-<arch>-<version>/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 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

      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 Quick Release Installation

   This is the fastest way to get everything installed. This do not install ethernet drivers, so it is assumed you already have them (see previous step).

   1. From the top directory just run the make and make install commands:
      --> make
      --> make install
      --> make boot # start on boot up (only works on RedHat-like operating systems)


At this point we need to install either Asterisk or FreeSWITCH

  Installing Sangoma Codec module for Asterisk 

   (Asterisk must be installed and Asterisk headers present in the system)

   1. make asterisk
   2. make install

 
  Installing Sangoma Codec module for FreeSWITCH

   (FreeSWITCH must be already installed and you need the source code from the FreeSWITCH git repository)

   1. cd /usr/src/freeswitch (assuming this is where your FreeSWITCH source code is located)
   2. Uncomment mod_sangoma_codec module in the modules.conf file
   3. make mod_sangoma_codec
   4. make mod_sangoma_codec-install

Sangoma Transcoding Auto Configuration

This step will auto detect all installed D100 cards and will create the necessary configuration. The utility used for configuration is called "sngtc_cfg".

This utility will probe all network interfaces in your system (WARNING: all network interfaces will be brought up if they are not already) searching for
transcoding modules. It will then ask for the configuration for each interface with transcoding modules. You can run sngtc_cfg with no arguments to see
the supported options.

   Configuring for Asterisk

   1. sngtc_cfg --server --asterisk

   Configuring for FreeSWITCH

   1. sngtc_cfg --server --freeswitch

Start SNGTC Server

   The Transcoding server must be started before starting Asterisk or FreeSWITCH. The Asterisk and FreeSWITCH modules will attempt to connect to the 
   transcoding daemon when loaded, if the transcoding server is not started, the modules won't operate properly.

   1. sngtc_server_ctrl start

   At this point Asterisk and/or FreeSWITCH can start using the transcoding server.


