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 project, but has refocused its development efforts primarily on Asterisk-based platforms including FreePBX. The information on this page and other FreeSwitch-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.


When using FreeSWITCH with FreeTDM, there are certain scenarios where installation is required to use FreeSWITCH DAHDI mode

Install the Sangoma hardware in FreeSWITCH DAHDI mode only if any of the following scenarios apply:

-> USBFXO (U100) installation
-> AFT analog card without Hardware echo cancellation and you require software echo cancellation
-> T1 RBS protocol support

This means that Dahdi must be installed over the Wanpipe driver, in order for FreeSWITCH to communicate with the Sangoma hardware below.  DAHDI mode is most likely compatible with Zaptel mode, but Zaptel is deprecated.  This mode depends on "ftmod_zt.so", which is always compiled, regardless of whether you have DAHDI or Zaptel.

On runtime, FreeTDM will try to determine (checking the existence of /dev/zap/ctl or /dev/dahdi/ctl) which one you have. In a typical DAHDI installation, the freetdm.conf file will be a basic mirror of the contents /etc/dahdi/system.conf (or /etc/zaptel.conf if using zaptel), but you still need them because they are used by dahdi_cfg or ztcfg to configure the hardware.

DAHDI and Wanpipe Installation

  1. DAHDI Installation

    Download Dahdi into an arbitrary directory (i.e. /usr/src) and untar it.
    -> tar xvfz dahdi-<version>
    -> cd dahdi-<version>
    -> make 
    -> make install

  2. Wanpipe Driver Installation
    Download the Wanpipe Driver 
    Untar wanpipe release in arbitrary directory (i.e. /usr/src/):
    -> tar xvfz wanpipe-<version>.tgz
    -> cd wanpipe-<version>
    -> 
    ./Setup dahdi
    ----
    Proceed with installation Select "Y" for each option.
    Setup will auto-detect dahdi sources in /usr/src
    select 'm' to manually specify dahdi source directory]

    Proceed with Defaults for the rest of the compilation.

    The Last step in installation will ask you: "Would you like to configure wanpipe devices for DAHDI? (y/n)"
    -> 
    SELECT NO
    --
  3. Confirm Successful Wanpipe/Zaptel Installation

    Run the following command to confirm that the Wanpipe driver has been installed successfully:
    -> wanrouter hwprobe

    You should have an output similar to the example below:

    --->Example (from usbfxo install):

     wanrouter hwprobe
     -------------------------------
      | Wanpipe Hardware Probe Info |
       -------------------------------
     1 . U100 : BUSID=4-1 : V=00
    
      Card Cnt: A101-2=0 A104=0 B700=0 U100=1 B600=0

FreeSWITCH Installation

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
  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>

  1. 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 

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)

 

  • Type: 
    -> wancfg_dahdi
     
    This is a Wanpipe script that will create the necessary DAHDI configuration files:

-> /etc/dahdi/system.conf
-> /etc/wanpipe/wanpipeX.conf (X represents a digit)

When prompted with:

    Would you like to generate /etc/asterisk/chan_dahdi.conf?
    -> SELECT NO (since chan_dahdi.conf will not be used here)


 

  • It is important to note that the Sangoma hardware will be a span of type "zt" in FreeSWITCH.  When configured in ZT mode, there is no span number in the channel configuration (Channel numbers are global).
    Please follow the applicable steps below:



  • If you are using FreeSWITCH DAHDI mode to provide software echo cancellation to your Analog card (w/o hardware echo cancellation), edit:

-> /usr/local/freeswitch/conf/freetdm.conf
 change all the span ] tags [span wanpipe wp1]to [span zt wp1]
---

  • If you are using FreeSWITCH DAHDI mode for USBFXO installation:

Copy and paste the samples below as the only context of /conf/freetdm.conf and /conf/autoload_configs/freetdm.conf.xml.  Make sure the channel numbers are correct if you have other DAHDI devices in the system.
 

freetdm.conf
[span zt usbfxo]
name => usbfxo 
trunk_type => fxo
group => 1
fxo-channel => 1
fxo-channel => 2


freetdm.conf.xml

<configuration name="freetdm.conf" description="Freetdm Configuration">
<settings>
<param name="debug" value="0"/>
<!--<param name="hold-music" value="$${moh_uri}"/>-->
<!--<param name="enable-analog-option" value="call-swap"/>-->
<!--<param name="enable-analog-option" value="3-way"/>-->
</settings>

<config_profiles>
</config_profiles>

<analog_spans>
<span name="usbfxo"/>
<param name="dialplan" value="XML"/>
<param name="context" value="default"/>
</analog_spans>

</configuration>


Make certain that <span name= xxxx /> is the same name in freetdm.conf (span zt=xxxx)
---

 

  • If you are using T1 RBS protocol with FreeSWITCH:
    Copy and paste the samples below as the only context of /conf/freetdm.conf and /conf/autoload_configs/freetdm.conf.xml:

    freetdm.conf
    [span zt wp1]
    trunk_type => EM
    em-channel => 1-24


    freetdm.conf.xml
    <configuration name="freetdm.conf" description="Freetdm Configuration">
      <analog_em_spans>
            <span name="wp1">
            <param name="dialplan" value="XML"/>
            <param name="context" value="default"/>
            </span>
    </analog_em_spans>
    </configuration>

 

  • All configuration options for ftmod_zt are typically located at:

    -> /usr/local/freeswitch/conf/zt.conf (dependent on freeswitch install directory)

     sample:
    
    [defaults]
    codec_ms => 20
    wink_ms => 150
    flash_ms => 750
    echo_cancel_level => 64
    rxgain => 0.0
    txgain => 0.0


    -----

  • At this point, all the configuration files are complete and are listed below:

    -> /etc/wanpipe/wanpipeX.conf
    -> /etc/dahdi/system.conf
    -> /usr/local/freeswitch/conf/freetdm.conf
    -> /usr/local/freeswitch/conf/autoload_configs/freetdm.conf
    ---------
  •  Start wanpipe and configure DAHDI spans
    -> wanrouter start
    -> dahdi_cfg (if not automated by wanpipe startup)
    ----

    Start FreeSWITCH, you are ready to go :)


 

  • No labels