Freetdm.conf Examples

From FreeSWITCH Wiki
Jump to: navigation, search

Please read FreeTDM page before trying to use this samples!

Contents

Examples for specific cards

Wildcard T100P

  • Wildcard T100P (should also work with similar DAHDI/Zaptel cards), This example will apply for Digium T1 cards as well:
 [span zt name_of_span]
 trunk_type => t1
 b-channel => 1-23
 d-channel=> 24

the name_of_span is the name of span that matches the one you set up in autoload_config/freetdm.conf.xml. span zt means you are using DAHDI or Zaptel.

This also works with Sangoma cards when the Sangoma card is configured in DAHDI mode (TDM_VOICE mode in wanpipex.conf).

PhonicEQ TE100P

  • This T1 PRI configuration is very similar to the Wildcard T100P and Tormeta2 configurations.
 [span zt PRI_1]
 trunk_type => t1
 b-channel => 1-23
 d-channel => 24
  • The /etc/zaptel.conf file generated by kernel/xpp/utils/genzaptelconf -d
 # Span 1: WCT1/0 "PhonicEQ Inc. T100P RAVEN T1/PRI Card 0" (MASTER)
 span=1,1,0,esf,b8zs
 # termtype: te
 bchan=1-23
 dchan=24
 
 # Global data
 
 loadzone        = us
 defaultzone     = us

Sangoma A10X

T1

 [span wanpipe PRI_1]
 trunk_type => t1
 b-channel => 1:1-23
 d-channel=> 1:24

E1

 [span wanpipe PRI_1]
 trunk_type => e1
 b-channel => 1:1-15
 d-channel=> 1:16
 b-channel => 1:17-31


Note: PRI_1 is the name of the span and must match your definitions in conf/autoload_configs/freetdm.conf.xml.

HFC 4 BRI

  • trunk_type => bri_ptmp is for Point-To-MultiPoint protocol
  • trunk_type => bri is for Point-To-Point protocol
[span zt BRI1]
trunk_type => bri_ptmp
b-channel => 1-2
d-channel=> 3

[span zt BRI2]
trunk_type => bri_ptmp
b-channel => 4-5
d-channel=> 6

[span zt BRI3]
trunk_type => bri
b-channel => 7-8
d-channel=> 9

[span zt BRI4]
trunk_type => bri
b-channel => 10-11
d-channel=> 12

HFC BRI

This is an example for a PCI HFC-S BRI ISDN card.

Please note that these cards basically work in FS, but there are problems with other devices on the S0-bus. The wiki will be updated as soon as these problems are delt with. *EDIT* It seems the problems are delt with. Let's wait and see. I'll report back as soon as some problems occur again.

[general]
cpu_monitor => no
cpu_monitoring_interval => 1000
cpu_set_alarm_threshold => 80
cpu_reset_alarm_threshold => 70
cpu_alarm_action => warn

[span zt ZTHFC1]
trunk_type => BRI_PTMP
number => 1
b-channel => 1-2
d-channel => 3

Sangoma A200/A400

  • A200, A200D, A400, A400D series and variants

The configuration depends on whether wanpipe is configured to use DAHDI/Zaptel TDM Voice, or the Sangoma standalone TDM Voice API. This is determined in the installation and configuration of the Sangoma wanpipe software.

If wanpipe is using Zaptel, you need to configure openzap.conf with [span zt] entries. For example, if ports 1 and 2 are FXO (e.g. configured to accept analog phone connections), and ports 3 and 4 are FXS (e.g. configured to accept PSTN analog lines) you will need:

/usr/local/freeswitch/conf/freetdm.conf:

[span zt FXS]
fxs-channel => 1
fxs-channel => 2

[span zt FXO]
fxo-channel => 3
fxo-channel => 4

If wanpipe native mode, you need to configure freetdm.conf with [span wanpipe] entries. For the same example as above this would be:

/usr/local/freeswitch/conf/freetdm.conf:

[span wanpipe FXS]
fxs-channel => 1:1
fxs-channel => 1:2

[span wanpipe FXO]
fxo-channel => 1:3
fxo-channel => 1:4

Also, note that in addition to configuring /usr/local/freeswitch/conf/freetdm.conf, you need to properly configure freetdm.conf.xml in freeswitch/conf/autoload_configs/.

/usr/local/freeswitch/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}"/>
  </settings>
  <!-- one entry here per openzap span -->
  <analog_spans>
    <span name="FXS">
      <!-- This is where the calls coming on this span will be directed -->
      <param name="dialplan" value="XML"/>
      <param name="context" value="default"/>
      <param name="enable_callerid" value="true"/> <!-- This is the default value anyway -->
    </span>
    <span name="FXO">
      <param name="dialplan" value="XML"/>
      <param name="context" value="default"/>
      <!-- Set this to the correct value for your area, to get the
           correct tones on the phones connected to the FXS ports -->
      <param name="tonegroup" value="us"/>
      <param name="enable_callerid" value="true"/>
    </span>
  </analog_spans>
</configuration>

Recent versions of the sangoma wanpipe drivers (3.5.x) include a tool (wancfg_fs) to generate this file for you, but you may still have to do some modifications to match your setup.

Tormenta2

  • A sample Tor2 setup with spans 1 and 2 set for FXO/FXS and spans 3 and 4 set for PRI, corresponds to Second freetdm.conf.xml example:
[span zt FXS1]
trunk_type => FXS
fxs-channel => 1-24

[span zt FXO1]
trunk_type => FXO
fxo-channel => 25-48

[span zt PRI1]
trunk_type => T1
b-channel => 49-71
d-channel => 72

[span zt PRI2]
trunk_type => T1
b-channel => 73-95
d-channel => 96
  • The /etc/dahdi/system.conf or /etc/zaptel.conf file for this tor2 config looks something like this:
## Test FreeSWITCH/FreeTDM config

span=1,0,0,esf,b8zs # FS to FXS span
fxoks=1-24

span=2,0,0,esf,b8zs # FS to FXO span
fxsks=25-48

span=3,1,0,esf,b8zs # PRI circuit
bchan=49-71
dchan=72

span=4,1,0,esf,b8zs # PRI circuit
bchan=73-95
dchan=96

# Global data

loadzone        = us
defaultzone     = us

Digium TDM400

  • A sample Digium TDM400 setup with spans 3 and 4 set for FXO and span 1 for FXS
  • note: please do not use fxo-channel => x:, you can however use fxo-channel => 3,4
[span zt FXS1]
fxs-channel => 1

[span zt FXO1]
fxo-channel => 3

[span zt FXO2]
fxo-channel => 4

Xorcom Astribank USB With 32 FSX ports =

/usr/local/freeswitch/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>
  <!-- one entry here per freetdm span -->
  <analog_spans>
    <span name="SPAN1">
      <!--<param name="hold-music" value="$${moh_uri}"/>-->
      <!--<param name="enable-analog-option" value="call-swap"/>-->
      <!--<param name="enable-analog-option" value="3-way"/>-->
      <param name="tonegroup" value="us"/>
      <param name="digit-timeout" value="2000"/>
      <param name="max-digits" value="11"/>
      <param name="dialplan" value="XML"/>
      <param name="context" value="default"/>
      <param name="enable-callerid" value="true"/>
      <!-- regex to stop dialing when it matches -->
      <!--<param name="dial-regex" value="5555"/>-->
      <!-- regex to stop dialing when it does not match -->
      <!--<param name="fail-dial-regex" value="^5"/>-->
    </span>
    <span name="SPAN2">
      <!--<param name="hold-music" value="$${moh_uri}"/>-->
      <!--<param name="enable-analog-option" value="call-swap"/>-->
      <!--<param name="enable-analog-option" value="3-way"/>-->
      <param name="tonegroup" value="us"/>
      <param name="digit-timeout" value="2000"/>
      <param name="max-digits" value="11"/>
      <param name="dialplan" value="XML"/>
      <param name="context" value="default"/>
      <param name="enable-callerid" value="true"/>
      <!-- regex to stop dialing when it matches -->
      <!--<param name="dial-regex" value="5555"/>-->
      <!-- regex to stop dialing when it does not match -->
      <!--<param name="fail-dial-regex" value="^5"/>-->
    </span>
    <span name="SPAN3">
      <!--<param name="hold-music" value="$${moh_uri}"/>-->
      <!--<param name="enable-analog-option" value="call-swap"/>-->
      <!--<param name="enable-analog-option" value="3-way"/>-->
      <param name="tonegroup" value="us"/>
      <param name="digit-timeout" value="2000"/>
      <param name="max-digits" value="11"/>
      <param name="dialplan" value="XML"/>
      <param name="context" value="default"/>
      <param name="enable-callerid" value="true"/>
      <!-- regex to stop dialing when it matches -->
      <!--<param name="dial-regex" value="5555"/>-->
      <!-- regex to stop dialing when it does not match -->
      <!--<param name="fail-dial-regex" value="^5"/>-->
    </span>
    <span name="SPAN4">
      <!--<param name="hold-music" value="$${moh_uri}"/>-->
      <!--<param name="enable-analog-option" value="call-swap"/>-->
      <!--<param name="enable-analog-option" value="3-way"/>-->
      <param name="tonegroup" value="us"/>
      <param name="digit-timeout" value="2000"/>
      <param name="max-digits" value="11"/>
      <param name="dialplan" value="XML"/>
      <param name="context" value="default"/>
      <param name="enable-callerid" value="true"/>
      <!-- regex to stop dialing when it matches -->
      <!--<param name="dial-regex" value="5555"/>-->
      <!-- regex to stop dialing when it does not match -->
      <!--<param name="fail-dial-regex" value="^5"/>-->
    </span>
  </analog_spans>
</configuration>

freetdm.conf

[span zt SPAN1]
fxs-channel => 1-8

[span zt SPAN2]
fxs-channel => 15-22

[span zt SPAN3]
fxs-channel => 23-30

[span zt SPAN4]
fxs-channel => 31-38

This gets 8 channels on 4 spans up (32 total), as we have 8 FSX ports per span. 'ls dahdi' should show your span map so your fxs- or fxo- channels can be modified depending on your hardware setup.

Dialplan

Here's a sample dialstring from directory/default/myextension.xml

<param name="dial-string" value="freetdm/1/8" />

Which rings port 8 on span 1 on the astribank.

See Also

FreeTDM