ftmod_isdn configuration

This page contains configuration instructions and examples for the ftmod_isdn OpenISDN connector plugin for FreeTDM (FreeSWITCH).


Before you start

Make sure you have all the information required for set up:

1. Type of Link?

T1 (US) or J1 (Japan), 23 B-Channels + 1 D-Channel?

E1 (Europe), 30 B-Channels + 1 D-Channel + 1 E-Channel (Sync)?

BRI PtP (Point-to-Point (Germany: Anlagenanschluss)) or BRI PtMP (Point-to-MultiPoint (Germany: Mehrgeräteanschluss))?

2. Mode of link?

TE (Terminal Equipment) / CPE (Customer Premises Equipment) – User side of the connection (e.g. Phone)?

NT (Network Termination) / NET (Network) – Network side (e.g. Phone ports on a PBX)?   (NOTE: Unsupported)

3. Dialect used?

Depending on your location or the type of equipment you want to connect to, the link will use one of the following dialects:

EuroISDN (DSS1 / Q.931)  –  Used in most of Europe, a slightly trimmed down version of the ITU-T Q.931 base standard.

5ESS –  The AT&T / Lucent dialect spoken by some equipment in the U.S.

DMS-100 –  The Nortel dialect used by some of their equipment, usually found in the U.S.

Q.SIG –  International standard for connections between multiple PBXes and private networks   (NOTE: Unsupported)

Please make sure whatever you choose here is actually supported by your build of the stack (‘libisdn-config -d’ will tell you).


These are the most important details you’ll need for setup.

Misconfiguration of one of these parameters may cause (sometimes hard to debug) failures later, like:

  • Link down (Trunk in state “Not aligned”)
  • New Calls in one (outgoing/incoming) or both directions failing
  • Active calls aborted
  • Errors/Warnings for invalid messages or Information Elements (IEs) reported by the stack



Configuration files

Here’s a short overview of FreeTDM’s configuration files and the settings.
NOTE: The FreeSWITCH wiki pages on FreeTDM have more example configurations.

First we’ll start with freetdm.conf which contains the base per-span settings such as channel mappings and line type:

#[span <IO_MODULE> <SPAN_NAME>]       # Name of the FreeTDM I/O plugin (e.g. zt)
#                                     # and our name for the span (e.g. PRI_1)
#trunk_type => <TYPE>                 # One of: T1, J1, E1, BRI, BRI_PTMP
#b-channel => <LIST OF B-CHANNELS>    # List/Range of B-Channel IDs, e.g.: 1-15,17-31
#d-channel => <D-CHANNEL>             # D-Channel ID, e.g.: 16

# Example #1: E1 PRI, using a Dahdi/Zaptel card
[span zt PRI_1]
trunk_type => E1
b-channel => 1-15,17-31
d-channel => 16

# Example #2: BRI PTMP, using a Dahdi/Zaptel card
[span zt BRI_1]
trunk_type => BRI_PTMP
b-channel => 1,2
d-channel => 3

Next up is freetdm.conf.xml, mod_freetdm’s configuration file, where we will have to set mode and dialect parameters for the spans:

<configuration name="freetdm.conf" description="FreeTDM Configuration">
   <param name="debug" value="0"/>

<!-- Known parameters:
   mode         # One of: te / user or nt / net
   dialect      # Possible values: q931, dms100, 5ess
                # See    'libisdn-config -d'
                # output for a list of supported dialects
   dialplan     # Send incoming calls to this dialplan
   context      # Send incoming calls to this context
   q921loglevel # Layer 2 log level: debug, info, notice, warning, error, critical
   q931loglevel # Layer 3 log level: debug, info, notice, warning, error, critical
<!-- Example #1:
 <span name="PRI_1">
   <param name="mode"     value="te"/>
   <param name="dialect"  value="q931"/>
   <param name="dialplan" value="XML"/>
   <param name="context"  value="isdn"/>
<!-- Example #2:
 <span name="BRI_1">
   <param name="mode"     value="te"/>
   <param name="dialect"  value="q931"/>
   <param name="dialplan" value="XML"/>
   <param name="context"  value="isdn"/>