Page tree
Skip to end of metadata
Go to start of metadata


Important Note Regarding FreeSwitch® and FreeTDM® Support

Support for FreeSwitch and FreeTDM for Sangoma telephony card products are no longer provided by Sangoma. All FreeSwitch drivers and applications are provided as-is with no warranty.  

Sangoma was previously involved in the FreeTDM and FreeSwitch projects, but has refocused its development efforts primarily on Asterisk-based platforms including FreePBX. The information on this page and other FreeSwitch- and FreeTDM-related pages on the Sangoma Wiki has been retained for historical and reference purposes, but should not be relied upon as reflecting Sangoma's current development efforts or support policies.

freetdm.conf

Sangoma + FreeSWITCH Overview

As a TDM hardware manufacturer Sangoma has concentrated its efforts in creating the best possible TDM APIs, Drivers and Hardware on the market.  

We have also invested in professional TDM stacks:

  • Trillium PRI/BRI
  • Trillium SS7
  • Ncom T1/E1/CAS/RBS/Analog.

Over the last few years Sangoma has been actively developing, testing and integrating its TDM APIs and Stacks into FreeTDM:  FreeSWITCH TDM framework.
Sangoma adopted FreeTDM Framework as its defacto standard high level TDM Signaling and Media API. 
Sangoma has used the FreeTDM API Layer as a Unified Signaling & Media TDM API for both Linux & Windows operating systems, for customers that are looking to develop VoIP/Voice/Media applications over Sangoma hardware.


 

libxml2

FreeTDM Native Features

 Open R2

  • ITU
  • Mexico
  • Brazil
  • Argentina
  • Philippines
  • DTMF R2 
  • Most other countries

Analog (FXO/FXS)

  • Loop Start
  • Kewl Start
  • Ground Start (FXS Only)
  • E&M
  • E&M Wink
  • FSK Caller ID


Sangoma FreeTDM ISDN Library (libsng_isdn)

 Features

Sangoma's ISDN Library uses Continuous Computing's (Trillium) LAPD and Q931 stacks to provide a commercial grade ISDN interface to FreeSWITCH, via the FreeTDM channel driver.


List of variants

  • National ISDN 2 (T1)
  • NT DMS-100 (T1) 
  • Lucent 5ESS (T1)
  • Lucent 4ESS (T1)
  • Euroisdn/ETSI (E1 and BRI)
  • INSNET/NTT (BRI & J1*)
  • QSIG** (E1)

*INSNET support on J1 is not fully tested yet.
** QSIG support has not been tested yet. 

Customer (CPE) and Network (NET) emulation are supported for all variants.
BRI point-to-point and point-to-multipoint are supported for EuroISDN and INS-NET variants.

Sangoma FreeTDM SS7 Library (libsng_ss7)

Features

Sangoma's SS7 Library uses Continuous Computing's (Trillium) MTP2/3 and ISUP stacks to provide a commercial grade SS7 interface to FreeSWITCH, via the FreeTDM channel driver.

List of supported variants

  • ISUP (ITU/ANSI)
  • MTP3 (ITU/ANSI)
  • MTP2 (ITU/ANSI)
  • SCCP API

Server and Operating system Selection

Selecting your server

Sangoma cards are compatible with most commercially available servers and motherboards on the market.
Our cards are available in both PCI and PCI express versions and are backwards compatible (i.e. 16x, 8x, 4x, 2x)
Also available are different size brackets for 1U and 2U server form factors.

 

For Sangoma analog card installations using FXS modules and/or remora expansion boards, please verify that your server has available molex power connection from internal power supply

Selecting your Linux Operating system

Sangoma cards are compatible with most official Linux distributions and kernels (i.e. CentOS, Debian, Ubuntu) 32 and 64-bit.
Sangoma recommends the use of CentOS as our R&D and QA departments use this distribution on a frequent basis.

 

Below are instructions for CentOS Installation.  If you would like use a different Linux Distro, please visit the appropriate online resources.

  1. Download latest CentOS distribution:
    32-bit: http://isoredirect.centos.org/centos/6/isos/i386/
    64-bit: http://isoredirect.centos.org/centos/6/isos/x86_64/
  2. After downloading the CentOS ISO, simply burn the image on CD/DVD using your choice of burning utility
  3. Boot your server with the CD/DVD containing your CentOS ISO.  Verify your BIOS settings allow for Boot from CD/DVD ROM drive
  4. Follow the on-screen prompts to Install your new operating system. You may wish to visit some online step-by-step tutorials (google:))
  5. Once completed, remove the CD/DVD from your server and reboot your server and log in to your freshly installed operating system

 

Preparing your Operating system for software packages

After installing your Linux operating system, you must prepare your server with the following software requirements before continuing. 
To install required system dependencies simply copy and paste the below string directly into your Linux command line. The string will automatically download and install missing dependencies on your server.  
 

must have internet connection for this step

 

Select only the option that applies to your environment:

CentOS (RedHat distros)

yum -y install kernel-devel-$(uname -r) libtool* make gcc patch perl bison flex-devel gcc-c++ ncurses-devel flex libtermcap-devel autoconf* automake* autoconf libxml2-dev cmake


Ubuntu/Debian

apt-get -y install gcc g++ automake autoconf libtool make libncurses5-dev flex bison patch libtool autoconf linux-headers-$(uname -r) libxml2-dev cmake

 

Installing Sangoma Driver (called 'Wanpipe')

The following instructions will guide you through the Installation of the Sangoma Wanpipe driver on your server that contains all required software packages already installed (i.e. Asterisk, DAHDI, Libpri).

  1. Download the latest official release of the Sangoma Wanpipe Driver
    1. Copy & Paste the line,without the quotes, into your Linux command line in the /usr/src/ directory.This will automatically download from the internet.
      -> "  wget ftp://ftp.sangoma.com/linux/current_wanpipe/wanpipe-current.tgz "

       

      If your server does not have internet access simply download the driver on another machine with internet access, then transfer the downloaded .tgz package to /usr/src on this serer.

  2. Un-compress the download Wanpipe driver (.tgz file) located in /usr/src
    1. tar xvfz wanpipe-current.tgz
    2. cd wanpipe-<version>/

     

  3. Compile and install the Sangoma Wanpipe driver by typing the following in the newly created wanpipe-<version> directory:
    ->
     make
    -> make install

    The 'make 'command will compile the driver. This process may take a few minutes.
    The 'make install' command installs the driver 

  4. Verify the Sangoma driver is installed by typing the following command on your Linux command line to verify that your system detects your Sangoma card(s) :

    -> wanrouter hwprobe

    Example output of a system with an a200, B700 and A108 card:

    [root@support-sys1 ~]# wanrouter hwprobe
    -------------------------------
    | Wanpipe Hardware Probe Info |
    -------------------------------
    1 . AFT-A200-SH : SLOT=4 : BUS=5 : IRQ=15 : CPU=A : PORT=PRI : HWEC=32 : V=11
    2 . AFT-B700-SH : SLOT=1 : BUS=7 : IRQ=3 : PORT=1 : HWEC=16 : V=35
    3 . AFT-B700-SH : SLOT=1 : BUS=7 : IRQ=3 : PORT=2 : HWEC=16 : V=35
    4 . AFT-A108-SH : SLOT=2 : BUS=7 : IRQ=14 : CPU=A : PORT=1 : HWEC=256 : V=44
    5 . AFT-A108-SH : SLOT=2 : BUS=7 : IRQ=14 : CPU=A : PORT=2 : HWEC=256 : V=44
    6 . AFT-A108-SH : SLOT=2 : BUS=7 : IRQ=14 : CPU=A : PORT=3 : HWEC=256 : V=44
    7 . AFT-A108-SH : SLOT=2 : BUS=7 : IRQ=14 : CPU=A : PORT=4 : HWEC=256 : V=44
    8 . AFT-A108-SH : SLOT=2 : BUS=7 : IRQ=14 : CPU=A : PORT=5 : HWEC=256 : V=44
    9 . AFT-A108-SH : SLOT=2 : BUS=7 : IRQ=14 : CPU=A : PORT=6 : HWEC=256 : V=44
    10. AFT-A108-SH : SLOT=2 : BUS=7 : IRQ=14 : CPU=A : PORT=7 : HWEC=256 : V=44
    11. AFT-A108-SH : SLOT=2 : BUS=7 : IRQ=14 : CPU=A : PORT=8 : HWEC=256 : V=44
    
    Sangoma Card Count: A108=1 A200=1 B700=1

Download and Install Software Package

For PRI or BRI support, you need to install the Sangoma ISDN Library (libsng_isdn).

If you have an analog card, no software package is required as FreeTDM has analog support already built in.


  1. Navigate to the /usr/src/ directory which will be used to store the downloaded libsng_isdn package. To do this type the following in your Linux command line, then press <enter>:
    1. -> cd /usr/src
       
  2. Download libsng_isdn by copy & pasting the following (without the quotes ""), then press <enter>:
    1. For 32-bit : " wget ftp://ftp.sangoma.com/linux/libsng_isdn/libsng_isdn-current.i686.tgz "
    2. For 64-bit : " wget ftp://ftp.sangoma.com/linux/libsng_isdn/libsng_isdn-current.x86_64.tgz  "


  3. Install the libsng_isdn by un-compressing the downloaded '.tgz' file and install using make command

    you are still inside the /usr/src/ directory by typing 'pwd' in the Linux command line. If you are not, navigate inside by typing 'cd /usr/src/' then press <enter>

     

    1. tar xfz libsng_ss7-current.<arch>.tgz

    2. cd libsng_isdn-<version>.<arch>

    3. make install


Now we are ready to download and install FreeSWITCH as our final step.

FreeSWITCH Installation

  1. Download FreeSWITCH into your /usr/src/ directory
    1. Copy and paste the below line into your Linux command line to automatically start downloading FreeSWITCH
      -> git clone -b v1.6 https://freeswitch.org/stash/scm/fs/freeswitch.git

      This command will download FreeSWITCH using Git the Git online repository. If you do not have Git on your system, you will need to download it first before running the above command.
      If you need to download Git on CentOS, simply type 'yum install git-all', or 'apt-get install git-all' for ubuntu 


  2. After the download is complete, you will notice a new directory called 'freeswitch'. You can verify this by typing 'ls' in your Linux command line.
  3. Navigate inside this new 'freeswitch' directory by typing the following in your Linux command line:
    -> cd freeswitch

    Its recommended to use Sangoma FreeTDM code . Follow Telephony Cards for FreeSWITCH#SangomaFreeTDM instructions to use Sangoma "FreeTDM" code.

  4. Type the following command to prepare the freeswitch system:
    -> ./bootstrap

    This will take a few minutes to complete.
  5. Enable mod_freetdm which will enable the FreeTDM signaling stack inside FreeSWITCH
    1.  Open the modules.conf file by typing the following:
      -> vi modules.conf
    2. un-comment  the following line by removing the '#' character from the beginning:

      -> #../../libs/freetdm/mod_freetdm

      So your result should look like:
      -> ../../libs/freetdm/mod_freetdm
       

    3. save and exit modules.conf
       

  6. Configure your FreeSWITCH system by typing the following command:
    -> ./configure

    (This will make the freeswitch working directory: /usr/local/freeswitch

    If you would like the working directory of freeswitch to be anything different than /usr/local/freeswitch you can indicate this by typing the following command, instead of './configure':
    -> ./configure --prefix=<location to install FreeSWITCH to> 

  7. Compile and Install FreeSWITCH
    1. Type the following command to compile FreeSWITCH:
      -> make
    2. Type the following command to install FreeSWITCH:
      -> make install

FreeSWITCH is now Installed 

Sangoma FreeTDM 

Its recommended to use our FreeTDM. User can start using Public FreeSwitch + Sangoma FreeTDM in either of the ways as described below:

Using already merged Public Freeswitch and Sangoma FreeTDM

Please find the below set of instructions to download the Public Freeswitch + Sangoma FreeTDM:

  1. Download Public Freeswtich + Sangoma FreeTDM compress file from Sangoma FTP server as given below:
    ftp://ftp.sangoma.com/linux/freeswitch/public_fs_merge_v1.6.tgz
  2. Now, untar the file using command as:

    Untar File
    tar -xvf public_fs_merge_v1.6.tgz
  3. Now, compile the freeswitch as usuall or can refer to  "sangoma-public-fs-compile.txt" as present within public_fs_merge_v1.6 folder, for freeswitch compilation related instruction

Important Note

  • The merged (Public Freeswitch + Sangoma FreeTDM) tar ball is created on Public Freeswitch below are the details:
    branch: v1.6
    commit:987c9b9a2a2e389becf4f390feb9eb14c77e2371

Using Sangoma FreeTDM and Manully merging it to Public Freeswitch

Please find below instructions to download our FreeTDM code and copy to Freeswitch source code directory before freeswitch compilation.

1. Download our FreeTDM source code. Copy and paste below line into your Linux command line to start download.
        -> git clone -b public_v1.6-merge https://git.freepbx.org/scm/core/freetdm.git

2. Copy the freetdm code to Freeswitch directory.
   a) mv <freeswitch_source_code_dir>/libs/freetdm /tmp/freetdm.bkup.junk
   b) cp -r <downloaded_freetdm_dir> <freeswitch_source_code_dir>/libs/freetdm

3. Please use the below script in order to apply patch and build freeswitch with our FreeTDM. Please find below script file below
    Sangoma FS-1.6 Patch Apply Script

NOTE: Once script is successfully executed "sangoma-public-fs-compile.txt" file is generated. User can refer to this file in order to get the details with respect to How to compile (sangoma + Public) merged FreeTDM with public Freeswitch

Configuration

To configure your Sangoma card(s), run the following command in your Linux command line:

-> wancfg_fs

This command will configure all your Sangoma cards in your system.

Simply follow the prompts and answer all the questions. 

 After running the wancfg_fs configuraiton tool, the following files will have been created:

  • Physical layer 
    • /etc/wanpipe/wanpipeX.conf  (x represents each port of your card. For analog cards, you will only see 1 for the entire card)
    • /etc/wanpipe/wanrouter.rc  (The Sangoma driver looks into this file to begin loading each port for your card(s)
    FreeTDM Signaling layer 
    • /usr/local/freeswitch/conf/freetdm.conf   (b and d channels)
    FreeSWITCH related files
    • /usr/local/freeswitch/conf/autoload_configs/freetdm.conf.xml  (channel details for your Sangoma card)

 

Click here for Sample Configuration files



Last Step:
Enable FreeTDM by editing modules.conf.xml located in /usr/local/freeswitch/conf/autoload_configs/ :

Type the following command in your Linux command line:
-> vi /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml

Locate the following line:
 <!-- <load module="mod_freetdm"/> --> 

Un-comment the line by removing the <!-- and -->:
i.e. <load module="mod_freetdm"/>


Save the file and exit.

 

Operation

To start the Sangoma driver, which also starts your Sangoma card(s) run the following command on your Linux command line:

-> wanrouter start 

 

card control commands start with 'wanrouter'


Immediately after running this command, you will see on-screen output of all the ports (i.e. wanpipe1, wanpipe2..etc) starting on your card.
You will also see your ports plugging into the DAHDI signaling layer.
If you see errors occurring, investigate the /var/log/messages file.

 

Starting FreeSWITCH

-> Background Mode  (Production)

/usr/local/freeswitch/bin/freeswitch -nc

Run "ps fax" to see if Freeswitch is up.
 

ps fax |grep freeswitch

Wait a few seconds, then run the FreeSWITCH CLI:

/usr/local/freeswitch/bin/fs_cli

Console Mode (Debugging)

/usr/local/freeswitch/bin/freeswitch -nonat


Stopping FreeSWITCH

If FreeSWITCH is currently running in Background Mode

/usr/local/freeswitch/bin/freeswitch -stop 

If FreeSWITCH is currently running in Console Mode

CLI> ...

 

 

 

 

 

 

 

 

 

 

  • No labels

11 Comments

  1. I can not download" Sangoma FreeTDM",the detail is below:

    [root@yi 桌面]#  git clone -b public_v1.6-merge ssh://git@git.freepbx.org/core/freetdm.git
    Initialized empty Git repository in /root/桌面/freetdm/.git/
    Permission denied (publickey).
    fatal: The remote end hung up unexpectedly
    [root@yi 桌面]#

    Please help me!

  2. You should be able to clone using https

    git clone -b public_v1.6-merge https://git.freepbx.org/scm/core/freetdm

  3. Per the instruction: CentOS v7 updated. Note, these instruction don't work with Debian 8 or 9.


    FreeSWITCH Installation, step 6

    Configure your FreeSWITCH system by typing the following command, with the working directory: /usr/local/freeswitch:

    -> ./configure

    I receive the following:

    ++++++++++++++++++++++++++++++++++++++

    checking for apr_queue_pop_timeout in -laprutil-1... no

    checking for jpeg_std_error in -ljpeg... no

    configure: error: no usable libjpeg; please install libjpeg devel package or equivalent

    ++++++++++++++++++++++++++++++++++++++


    Doing a yum install and I receive the following:

    ++++++++++++++++++++++++++++++++++++++

    Package libjpeg-turbo-1.2.90-5.el7.x86_64 already installed and latest version

    ++++++++++++++++++++++++++++++++++++++


    Thank you for any assistance you can provide.

    Michael


    1.  i would take that up with the freeswitch project – seems to be a regression ... FS-6554  


  4. Under the heading:

    Preparing your Operating system for software packages

    Ubuntu/Debian

    apt-get -y install gcc g++ automake autoconf libtool make libncurses5-dev flex bison patch libtool autoconf linux-headers-$(uname -r) libxml2-devel cmake


    The libxml2-devel needs to be changed to libxml2-dev

    apt-get -y install gcc g++ automake autoconf libtool make libncurses5-dev flex bison patch libtool autoconf linux-headers-$(uname -r) libxml2-dev cmake

  5. Debian 9

    After running the debian command to install gcc I then downloaded wanpipe, successfully the tar command, changed to the wanpipe directory and tried to run make. I received the following:

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    make KBUILD_VERBOSE=0 -C /lib/modules/4.9.0-3-amd64/build SUBDIRS=/usr/src/wanpipe-7.0.20/patches/kdrivers/src/net EXTRA_FLAGS=" -I/usr/src/wanpipe-7.0.20/patches/kdrivers/include -I/usr/src/wanpipe-7.0.20/patches/kdrivers/include/annexg -I/usr/src/wanpipe-7.0.20/patches/kdrivers/wanec -D__LINUX__ -I/usr/src/wanpipe-7.0.20/patches/kdrivers/wanec -I/usr/src/wanpipe-7.0.20/patches/kdrivers/wanec/oct6100_api -I/usr/src/wanpipe-7.0.20/patches/kdrivers/wanec/oct6100_api/include  -DCONFIG_PRODUCT_WANPIPE_BASE -DCONFIG_PRODUCT_WANPIPE_AFT -DCONFIG_PRODUCT_WANPIPE_AFT_CORE  -DCONFIG_PRODUCT_WANPIPE_AFT_TE1 -DCONFIG_PRODUCT_WANPIPE_AFT_TE3 -DCONFIG_PRODUCT_WANPIPE_AFT_56K -DCONFIG_WANPIPE_HWEC  -DCONFIG_PRODUCT_WANPIPE_SOCK_DATASCOPE -DCONFIG_PRODUCT_WANPIPE_AFT_BRI -DCONFIG_PRODUCT_WANPIPE_AFT_SERIAL  -DCONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN -DCONFIG_PRODUCT_WANPIPE_CODEC_SLINEAR_LAW -DCONFIG_PRODUCT_WANPIPE_AFT_RM  -DCONFIG_PRODUCT_WANPIPE_USB -DCONFIG_PRODUCT_WANPIPE_A700 -DCONFIG_PRODUCT_A600 -DCONFIG_PRODUCT_WANPIPE_AFT_A600 -DCONFIG_PRODUCT_WANPIPE_AFT_A700 -DCONFIG_PRODUCT_WANPIPE_AFT_B601 -DCONFIG_PRODUCT_WANPIPE_AFT_B800  -I/lib/modules/4.9.0-3-amd64/build/include/linux -I/usr/src/dahdi  -DKERN_PROC_PDE_FEATURE=2 -DKERN_SK_FOR_NODE_FEATURE=0 " ZAPDIR= ZAPHDLC= HOMEDIR=/usr/src/wanpipe-7.0.20 modules  

    make[1]: Entering directory '/usr/src/linux-headers-4.9.0-3-amd64'

      CC [M]  /usr/src/wanpipe-7.0.20/patches/kdrivers/src/net/sdladrv_src.o

    In file included from /usr/src/wanpipe-7.0.20/patches/kdrivers/src/net/sdladrv_src.c:128:0:

    /usr/src/wanpipe-7.0.20/patches/kdrivers/include/wanpipe_common.h: In function ‘wan_netif_set_ticks’:

    /usr/src/wanpipe-7.0.20/patches/kdrivers/include/wanpipe_common.h:2646:5: error: ‘struct net_device’ has no member named ‘trans_start’; did you mean ‘mem_start’?

      dev->trans_start = ticks;

         ^~

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    Three lines from the bottom it says net_device has no member.

    Thank you for any assistance you can provide.

    Michael

  6. Can you Install the below wanpipe driver to overcome the above error.

    ftp://ftp.sangoma.com/linux/custom/kapil/wanpipe-7.0.22-custom.tgz



  7. Debian 8 with updates and dependencies installed and installing for a Sangoma A200 series board.


    At the end of the make install I receive the messages:

    WARNING: installed module: ftmod_analog_em.so was not installed by this build.  It is not present in modules.conf.
    WARNING: installed module: ftmod_analog.so was not installed by this build.  It is not present in modules.conf.
    WARNING: installed module: ftmod_skel.so was not installed by this build.  It is not present in modules.conf.
    WARNING: installed module: ftmod_wanpipe.so was not installed by this build.  It is not present in modules.conf.
    WARNING: installed module: ftmod_zt.so was not installed by this build.  It is not present in modules.conf.

    What do I need to do to resolve this?

    Thanks for any assistance you can provide.

    Michael

    ps: I could not get past the Debian 9 crypto error. The wanpipe custom seems to do the trick, thank you.


    1. You can ignore the above stated warnings .

  8. When using analog for between 10 and 20 minutes Freeswitch segfaults with an error 4 in ftmod_wanpipe.so, the program terminates and all calls are dropped. I created a bug report with Freeswitch and they referred me to you.

    https://freeswitch.org/jira/browse/FS-10879

    Freeswitch is the only program running on the system, nothing locks, the system doesn't slow down, there are no errors in freeswitch.log.

    This only occurs when an analog port is being used, SIP to SIP works great.

    Though not specifically reproducible, the segfault occurs every time an analog port is being used for any duration.

    I am using a Sangoma A200 with 1 FXO and 1 FXS and DSP echo correction, Debian 8, DAHDI 2.11 and Wanpipe-7.0.22-custom. This is all running on a dedicated system using a Celeron N3050 @ 1.60GHz and 8G RAM.

    Looking forward to getting this resolved and getting it into production. Many thanks for your help,
    Michael

  9. HI Michael


    Could you please raise a support ticket t, so that we can have a look on this