Configuration OpenZAP- DigiumTDM400P Example

From FreeSWITCH Wiki

Jump to: navigation, search

Contents

Digium TDM400P Cards

Fix the 2 FXS cards on channels 1 and 3, and the 2 FXO cards on channels 2 and 4 respectively on the Digium TDM400P card.

Turn off your machine and fix the Digium TDM400P card with 2 FXS/ 2 FXO onto your machine.

Make sure you have inserted the power cables of the card properly.

Zaptel Driver Installation

The FXO/FXS card should be installed first to verify the zaptel installation. (Make sure the system has internet connectivity as downloads some utilities)

Download the latest zaptel-1.4.x.tar.gz from reliable sources. Untar the source tarball, compile and install it.

$tar -zxvf zaptel-1.4.x.tar.gz
$cd zaptel-1.4.x
$./configure
$make
$make install
$make config

Make sure you have the proper zaptel.conf in your /etc directory. Be cautious while configuring country zone in zaptel.conf at /etc. I didn't understand why we have to swap the channel numbers for FXS and FXO. For eg,

----- @/etc/zaptel.conf -----
loadzone=in
defaultzone=in
fxsks=4
fxoks=1
fxsks=2
fxoks=3

Add the wctdm and zaptel modules now.

$modprobe wctdm
$modprobe zaptel

Now verify the installation with the ztcfg command

$ztcfg -vv
Zaptel Version: 1.4.2
Echo Canceller: MG2
Configuration
======================
Channel map:
Channel 01: FXO Kewlstart (Default) (Slaves: 01)
Channel 03: FXO Kewlstart (Default) (Slaves: 03)
Channel 02: FXS Kewlstart (Default) (Slaves: 02)
Channel 04: FXS Kewlstart (Default) (Slaves: 04)
2 channels configured. 


Setup

1. Once you are done with installing zaptel drivers and fixed the FXS/FXO card on your machine, the green LEDs(Digium TDM400P card in my case) on your card will start glowing. (Good omen for you)

2. When you compile the Freeswitch code, make sure you have included openzap module by uncommenting the following line in ${Freeswitch_src)/modules.conf

../../libs/openzap/mod_openzap

3. After successful compilation, you have to put the openzap.conf.xml file into /usr/local/freeswitch/conf/autoload_configs/ as it will not be available there.For eg, you can use the sample openzap.conf.xml for Digium TDM400P at Openzap.conf.xml Examples


4. At the time of running Freeswitch from /usr/local/freeswitch/bin/, make sure again that <load module ="mod_openzap"/> is included in /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml

5.Make sure you see the Openzap FXS and FXO configuration messages on your console when you run Freeswitch. For example,

2008-05-01 18:10:32 [INFO] zap_zt.c:170 zt_open_range() configuring device /dev/zap/channel channel 1 as OpenZAP  device 1:1 fd:33
2008-05-01 18:10:32 [INFO] zap_zt.c:170 zt_open_range() configuring device /dev/zap/channel channel 2 as OpenZAP  device 2:1 fd:34
2008-05-01 18:10:32 [INFO] zap_zt.c:170 zt_open_range() configuring device /dev/zap/channel channel 3 as OpenZAP  device 1:2 fd:35
2008-05-01 18:10:32 [INFO] zap_zt.c:170 zt_open_range() configuring device /dev/zap/channel channel 4 as OpenZAP device 2:2 fd:36
2008-05-01 18:10:32 [INFO] zap_io.c:1978 load_config() Configured 4 channel(s)
2008-05-01 18:10:32 [CONSOLE] switch_loadable_module.c:749 switch_loadable_module_load_file() Successfully Loaded [mod_openzap]
2008-05-01 18:10:32 [NOTICE] switch_loadable_module.c:139 switch_loadable_module_process() Adding Endpoint 'openzap'
2008-05-01 18:10:32 [NOTICE] switch_loadable_module.c:245 switch_loadable_module_process() Adding API Function 'oz'

6. Now you can take a ride on your Ozzzzzzz... zip zap zoom ;)


Dialplan Configuration

1. To bridge an inbound call to your FXS that is configured on channel 1, for an UA registered as 507@proxy.com configure as below

<extension name="incoming-fxs-channel-1">
  <condition field="destination_number" expression="^(507)$">
    <action application="bridge" data="openzap/1/1"/>
  </condition>
</extension>

2. To bridge an outbound call onto your FXO card that is configured on channel 4, for any 10-digit destination configure as below

<extension name="outgoing-fxo-channel-4">
  <condition field="destination_number" expression="^([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])$">
    <action application="set" data="dialed_ext=$1"/>
    <action application="bridge" data="openzap/2/2/${dialed_ext}"/>
  </condition>
</extension>
Personal tools
Community