LibSangoma- Installation

     

    1. Solution
    2. Installation
    3. Configuration
    4. Startup/Operation
    5. Sample Code
    6. Sample Code Usage
    7. Production Code - Sangoma Media Gateway
    8. LibSangoma Custom Compilation
    9. Sample API configuration files

     


    Wanpipe TDM Voice API Solution 

    1. Wanpipe Release -> Download Here
      -> TDM API Driver
      -> LibSangoma User Library -> user space API.


    Wanpipe TDM Voice API is currently supported on all AFT hardware.

     


    Wanpipe Package Installation

    1. Untar LATEST release 
      tar xvfz wanpipe-<version>.tgz


    2. Change directory into wanpipe source directory
      cd wanpipe-<version>/

       
    3. Compile and install wanpipe driver
      make
      make install

        
    4. To confirm successful installation run:
      wanrouter hwprobe


    Wanpipe Package Configuration

    The wancfg_tdmapi tool will configure all wanpipe configuration files.

    1. Run: /usr/sbin/wancfg_tdmapi
      -> For each card wancfg_tdmapi will configure the span for voice only mode or voice + dchan.
      -> Furthermore, TDM API supports multiple DCHANS  so on can configure 
          channels 1-10 as voice and 11-24 as HDLC DCHANS.
         
    2. For full description of wanpipe1.conf files please refer to attached samples below.

     


    Wanpipe TDM API Startup & Operation

    Once the above wanpipe port configuration is complete using wancfg_tdmapi configuration utility. One has to start all ports.

    1.  
      wanrouter start

      ->This command will load and configure wanpipe drivers
      -> For full wanrouter usage click here  
    2. Full driver log and events are located in /var/log/messages
      ->
      tail -f /var/log/messages
        
    3. At this point TDM driver is configured and ready to tx/rx voice & dchan data.  One must make sure that ports are in connected state before trying to tx/rx data using the API programs.
      -> wanrouter status                           #check status of all ports
      -> wanpipemon -i w1g1 -c Ta            #check T1/E1 alarms of each port  
    4. Once all ports are connected the ifconfig command can be used to confirm that card running.
      -> ifconfig
          The rx/tx data packets should be incrementing
          The MTU value indicates the hardware chunk size
          Any rx or tx errors indicate that something is wrong with the data flow.
             -> overruns   : indicate dma problems  or mis-configured system.

     


    Wanpipe TDMAPI Sample Code


    Note: the /etc/wanpipe directory is created after wanpipe package installation.

    Sample code for tdm api is installed in /etc/wanpipe/api/tdm_api directory.

    1. cd /etc/wanpipe/api/tdm_api
    2. make
    3. Read the README file on how to use sample applications


    Wanpipe TDMAPI priserver Sample Code

    The priserver sample code combines simple tdm_api sample file with libpri library.

    The priserver is located in /etc/wanpipe/api/libsangoma/examples directory.

    1. cd /etc/wanpipe/api/libsangoma/examples
    2. make clean
    3. make
    4. make install

    Note: if you get a compilation error with priserver you have not compile libsangoma with the libpri support. Pleaser refer to installing libsangoma with libpri below.

     


    TDM API Sample Code  Usage

    1. aft_tdm_hdlc_test

      This application is used to tx/rx HDLC data to and from a voice or dchan.  It is useful as a CRC data test to confirm that all voice & dchan channels are working free of bit errors.

      ->./aft_tdm_hdlc_test  wanpipe1 <span-chan device> <span-chan device> ....

      ->eg: ./aft_tdm_hdlc_test wanpipe1 s1c1
                Start hdlc tx/rx on span 1 chan 1


      ->eg:  ./aft_tdm_hdlc_test wanpipe1 s1c1 s1c2
                Start hdlc tx/rx on both span 1 chan 1 and span 1 chan 2 

      With this application one can test the full card by specifying all spans and chans on the command line.
      A small script is included in this directory that can simplify the use to this application
      -> ./tdm_hdlc_test.sh  "span list"  "chan list"
        
      -> eg: ./tdm_hdlc_test.sh  1 1            # Start hdlc test on span 1 chan 1
                ./tdm_hdlc_test.sh   "1 2" 1      # Start hdlc test on chan 1 of span 1 & 2
                ./tdm_hdlc_test.sh   1              # Start hdlc test on all chans for span 1   

     


    Wanpipe TDM API in Production - Sangoma Media Gateway SMG

    The Sangoma Media Gateway has been built on TDM API. Once can look at the the production code to see how one would use the TDM API to build a full media gateway applicatoins.

    The Sangoma Media Gateway is located in every wanpipe release

    1. cd wanpipe-<version>
    2. cd ssmg/sangoma_mgd.trunk
    3. vi sangoma_mgd.c
      -> search for all instances of "sangoma_"  these are all
          libsangoma api functions used in the media gateway.
     

     


    Wanpipe LibSangoma Installation


    Libsangoma is installed automatically during the installation process!
    These instructions are here for information sake, in case one wants to recompile libsangoma library.

    The LibSangoma is installed in /etc/wanpipe/api/libsangoma

    1. cd /etc/wanpipe/api/libsangoma
    2. ./configure
    3. make
    4. make install
    5. Add library path /usr/local/lib into /etc/ld.so.conf
    6. Run ldconfig to accept /etc/ld.so.conf changes.


    Wanpipe LibSangoma with LibPRI Installation (Optional must be done manually)

    1. Download  libpri from www.asterisk.org and save it into /usr/src directory.
    2. Untar libpri tgz file in /usr/src directory
    3. Change directory into libpri and run: make; make install
    4. cd /etc/wanpipe/api/libsangoma
    5. ./configure  --with-libpri=/usr/src/<libpri directory>
    6. make
    7. make install
    8. Add library path /usr/local/lib into /etc/ld.so.conf
    9. Run ldconfig to accept /etc/ld.so.conf changes.

    Sample API configuration Files

    -> Voice API Configuration file
    -> Analog Voice API Config
    -> PRI-mode Voice API Config     
    -> PRI-datascope-tap-mode