FreeSWITCH Dahdi Mode
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.
- Package requirements prior to Wanpipe installation
- Wanpipe-Dahdi Installation for FreeSwitch
- Wanpipe-FreeSWITCH installation
- Configuration
-> USBFXO
-> AFT analog
-> T1 RBS
| 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/
- 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
- - 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 NO
-- - 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
If the output looks like:
---> FATAL: Error inserting wanpipe (/lib/modules/2.6.18-194.el5PAE/kernel/drivers/net/wan/wanpipe.ko): Unknown symbol in module, or unknown parameter (see dmesg)
please contact Sangoma support at techdesk@sangoma.com
FreeSwitch Installation
- 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
- - Prepare the build system using "bootstrap.sh"
-> ./bootstrap.sh
- - 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
- - 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
- - Compile all source code using "make"
-> make
- - Install the compiled binaries using "make install"
-> make install
Configuration
- Type: wancfg_fs
wancfg_fs is a Wanpipe script that will create the necessary FreeSWITCH configuration files:
-> freetdm.conf
-> freetdm.conf.xml
Note: wanpipeX.conf will also be created, but will be overwritten by the end of the configuration process
----- - Type: wancfg_dahdi
wancfg_dahdi 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
and 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>
- If you are using FreeSWITCH DAHDI mode to provide software echo cancellation to your Analog card (w/o hardware echo cancellation), edit:
- 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 :)







