WELCOME [ Log In · Register ]        SITE [ Search · Page Index · Recent Changes ]    RSS

USBFXO on FreeSwitch

    When using FreeSWITCH and FreeTDM, the USBFXO is the only Sangoma hardware that requires to be used in DAHDI Mode.
    This means that Dahdi must be installed over the Wanpipe driver, in order for FreeSWITCH to communicate with the USBFXO. 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.
  1. Package requirements prior to Wanpipe installation
  2. Wanpipe-Dahdi Install for FreeSwitch
  3. FreeSwitch Installation
  4. Configuration

IMPORTANT: The USB FXO drivers are only guaranteed to work on Centos Installations.
Due to rapidly changing kernel USB core we have to limit the USB FXO drivers to Centos installations only. 

If you are trying to use the USB FXO on anything else than Centos and you have issues we might not be able to help you.  


DAHDI/Wanpipe Installation

Note: DAHDI sources can be downloaded from http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/

  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 : ftp://ftp.sangoma.com/linux/current_wanpipe/wanpipe-current.tgz
    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 YES

    When prompted with :

    Would you like to generate /etc/asterisk/chan_dahdi.conf?
    -> SELECT NO (since chan_dahdi.conf will not be used here)
    -
  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:
    # 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

  1. Download FreeSWITCH from the latest GIT trunk in an arbitary directory (i.e. /usr/src/):
    -> cd /usr/src/
    -> git clone git://git.freeswitch.org/freeswitch.git

    Note: Git must be installed for the above method
    -
  2. Prepare the build system using "bootstrap.sh"
    -> ./bootstrap.sh
    -
  3. Add mod_freetdm to the modules to compile by un-commenting it in modules.conf

    -> open modules.conf with your preferred text editor
    -> search for "libs/freetdm/mod_freetdm" in modules.conf
    -> remove the # from the beginning of line
    -
  4. Configure the build system using "configure"

    -> ./configure --prefix=<location to install FreeSWITCH to>

    NOTE: "--prefix" is an optional parameter, if a install location is not specified FreeSWITCH will install to /usr/local/freeswitch

    -
  5. Compile all source code using "make"
    -> make
    -
  6. Install the compiled binaries using "make install"
    -> make install

    -


Configuration

  1. After "wancfg_dahdi" has been executed, the following files should have been created:

    -> /etc/wanpipe/wanpipeX.conf (i.e. wanpipe1.conf, or whichever interface the USBFXO happens to be )
    -> /etc/dahdi/system.conf

  2. Manually create the FreeSWITCH configuration files

    -> freetdm.conf

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

    It is important to note that the USBFXO will be a span of type "zt".  When configued in ZT mode, there is no span number in the channel configuration (Channel numbers are global).   You may simply copy and paste the above as the only context of /conf/freetdm.conf.  Make sure the channel numbers are correct if you have other dahdi devices in the system.


    -> /conf/autoload_configs/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>

    Simply copy and paste the above as the only contents in /autoload_configs/freetdm.conf.xml. Make certain that <span name= xxxx /> is the same name in freetdm.conf (span zt=xxxx)

    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
    -
  3. Start wanpipe and configure DAHDI spans
    -> wanrouter start
    -> dahdi_cfg (if not automated by wanpipe startup)
    -
  4. Start FreeSWITCH
    -
  5. You are ready to go :)