Asterisk PRI


Collect and organize information pertaining to Integrated Services Digital Network ISDN Primary Rate Interface PRI functionality on Asterisk. Most cards use the Zaptel channel driver or DAHDI.

Hardware Installation

You'll need an adapter from a vendor such as Digium, Sangoma (or Cronyx), OpenVox, Rhino Equipment T1/E1 WAN interfaces, beroNet beroFix card or Positron Telecom. As a general rule, these interfaces should be installed in your Asterisk system PCI bus prior to compiling or configuring the system.


Digium Digital TDM Cards
  • TE411P - 4 span T1/E1/J1 Card with Hardware Echo Cancellation for 3.3v PCI
  • TE410P - 4 span T1/E1/J1 Card for 3.3v PCI
  • TE406P - 4 span T1/E1/J1 Card with Hardware Echo Cancellation for 5v PCI
  • TE405P - 4 span T1/E1/J1 Card for 5v PCI
  • TE210P - 2 span T1/E1/J1 Card for 3.3v PCI
  • TE205P - 2 span T1/E1/J1 Card for 5v PCI
  • TE110P - 1 span T1/E1/J1 Card for 3.3v or 5v PCI

Deprecated Digital TDM Cards (Still supported - no longer marketed)
  • T100P - 1 span T1 Card for 5v PCI
  • E100P - 1 span E1 Card for 5v PCI

The drivers for these cards are in the zaptel portion of the Asterisk build.

Here's the Digium wiki page.


beroNet offers driver independant PRI(E1) PCI and PCIe cards. They run on Linux and
Windows. They are very easy to setup compared to passive cards. berofix solves the
traditional VoIP to TDM issues like Echo and Fax and it is even modular.


OpenVox offers following T1/E1 cards
  • D410P - 4 span T1/E1/J1 Card for 5v and 3.3v PCI.
  • D210P - 2 span T1/E1/J1 Card for 5v and 3.3v PCI.
  • D110P - 1 span T1/E1/J1 Card for 5v and 3.3v PCI.

Both D410P/D210P/D110P are high-performance PCI BusMaster Cards and very easy to us.

The drivers for these cards are also in the zaptel portion of the Asterisk build.

Positron Telecom

Positron is the only provide of a PBX Blades - all you need to do is configure it through a web browser. ZAP and DADHI are running on the board so it will not require any CPU resources on the board and can even be installed in Windows or VMWARE. Positron offers better performance, easier configuration, the fastest echo canceller and much much more:


Sangoma offers the A104, A102, and A101 cards for use with Asterisk. These are suitable for use in a PRI application.

Here's the Sangoma wiki page.


You can also use E1 cards from Russian designer/manufacturer company Cronyx. Tau-PCI/2E1(4E1) (2 or 4 ports) is obsolete design. Tau32 (2-port but only 1 port can be used - see below) and Tau32-lite (1-port) devices are of relatively new design, giving excellent results in our tests and running in production for almost year already.

It is very important to mention, that even on 2port tau32 device you can use only one E1. This is because it's internal design consists of 3 E1s - 2 are ports, and third is logical E1 routed to PCI and further - into your favourite software package. Between ports and internal E1 sits cross-connector which can pick and combine timeslots from ports, and directly link any unused timeslots. But it is technically impossible to feed more than 2048kbit of data from/to any Tau32 board.

2-port Tau32 device is ideal for custom telephony applications like signalling converters and signalling proxy. Just extract out signalling timeslots from each port, and B-channels are automatically cross-connected by hardware.

But for Asterisk, just stuff in enough Tau32-lites into your box.

Rhino Equipment

  • R1T1 - 1 Port E1/T1/J1 Digital Telephony PCI Plug-In Card
  • R2T1 - 2 Port E1/T1/J1 Digital Telephony PCI OR PCI Express Plug-In Card
  • R4T1 - 4 Port E1/T1/J1 Digital Telephony PCI OR PCI Express Plug-In Card
  • All Digital cards available with Echo Clear tm
Here's the Rhino Equipment Corp wiki page.

Software Installation

Download Asterisk related software and use the Asterisk Handbook as a road map.

If you are using Sangoma cards, follow the entire installation procedure described in the Sangoma wiki link shown below. The difference is that Asterisk software is untarred, Sangoma drivers are untarred and built, then zaptel is built, followed by libpri being built (optional), and Asterisk being built.

libpri Installation

Nothing special about installing Asterisk libpri. Just follow the instructions.

zaptel Installation

Asterisk zaptel Installation

Asterisk Installation

Asterisk Installation tips
Another suggestion is to use asterisk@home as a setup and configuration tool.

Sangoma Driver Installation

The Sangoma installation process in an Asterisk system is described in the
Wanpipe for Asterisk section of the Sangoma wiki.

You should use the latest driver revision unless specifically told to do otherwise. You may download the latest driver tarball from the Sangoma ftp server.

During the Sangoma setup process you must specify AFT_TE1-DEF-TDM in the customized protocol list and supply other responses as described in the Sangoma wiki.

                  WAN Router vbeta8-2.3.3 Installation Script
            Copyright (c) 1995-2005, Sangoma Technologies Inc.

DEFAULT Protocols
[FR]      : Frame Relay       [PPP]     : PPP
[CHDLC]   : Cisco HDLC        [X25]     : X25 API

[MFR]     : MP Frame Relay    [MPROT]   : MP Prot
[ADSL]    : ADSL (S518)       [ATM]     : ATM

[AFT_TE1] : AFT_TE1 (A101/2/4)[AFT_TE3] : AFT_TE3 (A105)

API Protocols
[SDLC]    : SDLC              [BISYNC]  : MP Bisync
[BSCSTRM] : Bisync Stream     [BITSTRM] : Bit Stream
[POS]     : POS (S509/S515)   [EDU]     : Wan EduKit
[SS7]     : SS7 L2            [MPAPI]   : MP API
[LIPAPI]  : LIP XDLC/LAPB     [TDM]     : TDMV Asterisk

[DEF] : Enable All Default    [API] : Enable All API
[ALL] : Enable All Protocols  [NONE]: Disable ALL Protocols

[EXIT|Q|q]: Exit Protocol Selection

Please select a protocol option in [<opt>]: AFT_TE1-DEF-TDM
Enabling the AFT TE1 Support

Please specify absolute path to Zaptel source directory

        (Press Enter for Default: /usr/src/zaptel)

Enabling the TDM Voice Asterisk Support

Compile TDMV DCHAN Native HDLC Support (y/n)? (y/n) y

Zaptel DCHAN patch V.02 already installed

Note: Please recompile/reinstall ZAPTEL drivers

Confirm Zaptel Patching: yes/no to continue! (y/n) 

After following the instructions in README.asterisk you can test your work as follows:

[root@b4 asterisk]# wanrouter hwprobe

| Wanpipe Hardware Probe Info |
1 . AFT-A102u  : SLOT=9 : BUS=1 : IRQ=4 : CPU=A : PORT=PRI
2 . AFT-A102u  : SLOT=9 : BUS=1 : IRQ=4 : CPU=B : PORT=PRI

Gathering Configuration Information

Installed Span Numbers

Gathering the span number information is trivial if you have only one T1 or E1 card in an Asterisk box. The task becomes ponderous with the addition of a second card.
  1. Digium spans are numbered according to the order of their loading. Associating a span number with a physical port is obvious if there is only one E1 or T1 card in the system. If the card has four ports then the port 1-4 are configured as spans 1-4. If there are 2 or more cards in the system, then a manual discovery procedure is needed to know how to associate card and port number to span number. In fact, there are two procedures, where one is for distingushing T1 from E1, and the other for distinguishing between two similar interfaces. The second procedure requires an E1 or T1 circuit that is turned up on the far end - which might be difficult to know with a virgin system. In this case it might be useful install and configure only one T1/E1 card so an operational benchmark is established.
  2. Sangoma spans are defined instead of discovered from loading order. Span numbering should begin with 1 if there are no Digium spans in the system. Span numbers are defined in zaptel and Sangoma configuration files later on. One should probably begin Sangoma span numbers which the next value after the last Digum span in a system with both Digium and Sangoma spans. The Sangoma README.asterisk explains that it is important to start the Sangoma ports in span number order. They must be stopped in reverse span number order. The order of starting and stopping Sangoma ports also depends on clocking choices which is described in the the README.asterisk file. More detail on these topics will be provided later in this document.


  1. T1 or E1
  2. Line Encoding (B8ZS, AMI, HDB3)
  3. T1 Framing and E1 Framing
  4. Line build out
  5. Clock reference


  1. Network position; what side of the U interface in the ISDN network interface model will the Asterisk side of the PRI occupy; will the Asterisk side of the link be a network ISDN switch or will be an NT1 customer premises equipment
  2. Voice channel identification (B channels)
  3. Signaling channel identification (D channel)
  4. Switchtype
  5. PRI dialplan

Configuring the Interfaces and Services

Information gathered in the previous step is presented to the Asterisk system through the configuration files described in this section.


Here is the reference material:
  1. Comments in /etc/zaptel.conf itself
  2. Digium PDF file
  3. Asterisk config zaptel.conf
  4. Digium Notes on Hardware
This file covers all of the interface types. Only the PRI aspects are covered in this discussion. If you are using Sangoma T1/E1 interfaces the be aware that the information in /etc/zaptel.conf must be closely synchronized with the Sangoma configuration process described later in this document.

The example that is commonly used in Asterisk documentation follows:


This stanza describes a T1 carrying PRI service. The B channels are on slots 1-23 and the D channel is on slot 24. Most people talk about slots 1-24 on a T1. Systems vary and use 0-23 or 1-24. When coordinating channelized services always confirm how the slots are numbered.

T1 has 24 channels and up to 24 channels may be used to carry voice and signaling.

E1 has 32 channels. Channel 0 is used for framing. Channel 16 is often used for signaling. Channels 1-15 and 17-31 are used to carry voice.

Use the references above to understand the span= line.

It is important to fully understand the meaning and operational implications of timing parameter choice. A good place to start is with the O'Reilly T1: A Survival Guide.There should be a single clock master for all links. It's not clear if the master applies to both T1 and E1 in a single Asterisk platform supporting both types of facilities from the existing documentation.

A clarification of T1/E1 timing concepts was presented on the asterisk-users list and is copied here:

# span=<span num>,<timing source>,<line build out (LBO)>,<framing>,<coding>[,yellow]
# All T1/E1 spans generate a clock signal on their transmit side. The          
# <timing source> parameter determines whether the clock signal from the far
# end of the T1/E1 is used as the master source of clock timing. If it is, our
# own clock will synchronise to it. T1/E1's connected directly or indirectly to
# a PSTN provider (telco) should generally be the first choice to sync to. The
# PSTN will never be a slave to you. You must be a slave to it.
# Chose 1 to make the equipment at the far end of the E1/T1 link the preferred
# source of the master clock. Chose 2 to make it the second choice for the master
# clock, if the first choice port fails (the far end dies, a cable breaks, or
# whatever). Chose 3 to make a port the third choice, and so on. If you have, say,
# 2 ports connected to the PSTN, mark those as 1 and 2. The number used for each
# port should be different.
# If you choose 0, the port will never be used as a source of timing. This is
# appropriate when you know the far end should always be a slave to you. If the
# port is connected to a channel bank, for example, you should always be its
# master. Any number of ports can be marked as 0.
# Incorrect timing sync may cause clicks/noise in the audio, poor quality or failed
# faxes, unreliable modem operation, and is a general all round bad thing.

Sangoma Configuration

Configuring the Sangoma interfaces requires making Sangoma specific choices and re-entering some information that was put into /etc/zaptel.conf described above.

There is a configuration tool (/usr/sbin/wancfg) that's built and installed. The tool is an ncurses application that takes the user through a series of menus. At the end of the process the configuration tool write a file to /etc/wanpipe/wanpipeX.conf where X is a number 1..n and corresponds to a T1/E1 port on a card. It's important to understand that Sangoma interfaces support many data protocols, so there are many choices that simply don't apply to an Asterisk PRI setup.

Sangoma also offers channelization in some product model where on-card logic provides low-level bit-oriented functions which significantly reduces main CPU loading.

The clock hierarchy is also addressed in the Sangoma configuration but it is outside the current capability of the configuration tool. This modification must be done by hand to each /etc/wanpipe/wanpipeX.conf file.


In /etc/asterisk/zapata.conf you'll something like the stanza below to get started:

channel => 1-23

Asterisk ZAP Channels is a general reference on configuring zapata.conf.

A less common configuration is to connect to a carrier LD (long distance PRI). In this scenario you will typically connect to a Lucent 4ESS tandem switch. The zapata.conf configuration for this connection is:

;Sangoma A102 port 1 [slot:1 bus:3 span: 1]
switchtype => 4ess
signalling => pri_cpe
pridialplan => unknown
channel => 1-23
use_callerid => yes

Testing and Troubleshooting

Start Up

  1. Watch the /var/log/messages file in a background process: tail -f /var/log/messages&
  2. Install Sangoma drivers if you have them: wanrouter start
  3. Install zaptel drivers: modprobe <all applicable device drivers>
  4. Run the zaptel configuration tool: /sbin/ztcfg -vv
  5. Start Asterisk: /usr/sbin/asterisk -cvvv

; What exactly is the meaning / function of the pridialplan & prilocaldialplan?

Both set the two fields Type Of Number (TON) and Numbering Plan (NPI)
markers on an outgoing isdn call. These two tell a receiving isdn switch
how to interpret the accompanying digits.

The "pridialplan" option controls the TON+NPI associated with the Called
Party information element. This is the recipient of the call.

The "prilocaldialplan" option controls the TON+NPI associated with the
Calling Party information element. This is the originator to be presented
to the receiving user (think CallerId).

Sangoma describes a method for automating this process.

Verify Loading and Functioning

Verify the successful loading of modules by watching the /var/log/messages tail. Errors will be plainly evident. If the drivers are loaded without errors in /ver/log/messages, then use lsmod to inspect what is currently loaded. Here is the output from lsmod on a system with an TDM400P and a Sangoma A102:

[root@b4 asterisk]# lsmod
Module                  Size  Used by    Not tainted
wctdm                  37856   0  (unused)
wanpipe_lip            62143   0  (unused)
af_wanpipe             30852   0  (unused)
wanpipe               228912   1 
wanrouter              31256   3  [wanpipe_lip af_wanpipe wanpipe]
sdladrv                45884   0  [wanpipe wanrouter]
zaptel                179872   0  [wctdm wanpipe]

To check that your zaptel PRI driver is loaded and running, run:

# cat /proc/interrupts

 10: 1589984842          XT-PIC  t1xxp

The large number should increment 1000 times per second. This works best if the driver is not sharing an interrupt with any other device.

The ouput from the zaptel configuration tool on the system with a TDM400P and Sangoma A102 looks like this:

[root@b4 asterisk]# /sbin/ztcfg -vv

Zaptel Configuration

SPAN 1: ESF/B8ZS Build-out: 0 db (CSU)/0-133 feet (DSX-1)

Channel map:

Channel 01: Individual Clear channel (Default) (Slaves: 01)
Channel 02: Individual Clear channel (Default) (Slaves: 02)
Channel 03: Individual Clear channel (Default) (Slaves: 03)
Channel 04: Individual Clear channel (Default) (Slaves: 04)
Channel 05: Individual Clear channel (Default) (Slaves: 05)
Channel 06: Individual Clear channel (Default) (Slaves: 06)
Channel 07: Individual Clear channel (Default) (Slaves: 07)
Channel 08: Individual Clear channel (Default) (Slaves: 08)
Channel 09: Individual Clear channel (Default) (Slaves: 09)
Channel 10: Individual Clear channel (Default) (Slaves: 10)
Channel 11: Individual Clear channel (Default) (Slaves: 11)
Channel 12: Individual Clear channel (Default) (Slaves: 12)
Channel 13: Individual Clear channel (Default) (Slaves: 13)
Channel 14: Individual Clear channel (Default) (Slaves: 14)
Channel 15: Individual Clear channel (Default) (Slaves: 15)
Channel 16: Individual Clear channel (Default) (Slaves: 16)
Channel 17: Individual Clear channel (Default) (Slaves: 17)
Channel 18: Individual Clear channel (Default) (Slaves: 18)
Channel 19: Individual Clear channel (Default) (Slaves: 19)
Channel 20: Individual Clear channel (Default) (Slaves: 20)
Channel 21: Individual Clear channel (Default) (Slaves: 21)
Channel 22: Individual Clear channel (Default) (Slaves: 22)
Channel 23: Individual Clear channel (Default) (Slaves: 23)
Channel 24: D-channel (Default) (Slaves: 24)
Channel 25: FXS Kewlstart (Default) (Slaves: 25)
Channel 26: FXO Kewlstart (Default) (Slaves: 26)
Channel 27: FXO Kewlstart (Default) (Slaves: 27)
Channel 28: FXO Kewlstart (Default) (Slaves: 28)

28 channels configured.

To see the state of your digium PRI card run:

# cat /proc/zaptel/1

Span 1: WCT1/0 "Digium Wildcard E100P E1/PRA Card 0" HDB3/CCS

           1 WCT1/0/1 Clear (In use)
           2 WCT1/0/2 Clear (In use)
           3 WCT1/0/3 Clear (In use)
           4 WCT1/0/4 Clear (In use)
           5 WCT1/0/5 Clear (In use)
           6 WCT1/0/6 Clear (In use)
           7 WCT1/0/7 Clear (In use)
           8 WCT1/0/8 Clear (In use)
           9 WCT1/0/9 Clear (In use)
          10 WCT1/0/10 Clear (In use)
          11 WCT1/0/11 Clear (In use)
          12 WCT1/0/12 Clear (In use)
          13 WCT1/0/13 Clear (In use)
          14 WCT1/0/14 Clear (In use)
          15 WCT1/0/15 Clear (In use)
          16 WCT1/0/16 HDLCFCS (In use)
          17 WCT1/0/17 Clear (In use)
          18 WCT1/0/18 Clear (In use)
          19 WCT1/0/19 Clear (In use)
          20 WCT1/0/20 Clear (In use)
          21 WCT1/0/21 Clear (In use)
          22 WCT1/0/22 Clear (In use)
          23 WCT1/0/23 Clear (In use)
          24 WCT1/0/24 Clear (In use)
          25 WCT1/0/25 Clear (In use)
          26 WCT1/0/26 Clear (In use)
          27 WCT1/0/27 Clear (In use)
          28 WCT1/0/28 Clear (In use)
          29 WCT1/0/29 Clear (In use)
          30 WCT1/0/30 Clear (In use)
          31 WCT1/0/31 Clear (In use)

If you are pretty sure that your system is configured O.K. but it isn't working (i.e. /proc/zaptel/1 includes the words 'down' or 'error'!)
ring your ptt (or whoever is on the other end of the E1 line) and ask them if they have provisioned the line and if it is in service. (often they won't do this until you ask them.) They may also take a line out of service if it gives too many errors, so you may need to call them after an outage or hardware replacement.

If you change low level PRI parameters (eg clock source) it is worth powercycling your asterisk box. This ensures that both ends of the E1 start with the fresh configuration.

Specifics on Service Variations

Identify and explain variations by country, equipment, etc.

Country Variations


Telus PRI setup details

United Kingdom

  • If you wish to set the outgoing callerID you need to tell your PTT that you wish to do this, and ask them how many digits they expect you to send. 20050602, Nick Barnes - The above isn't necessarily true. All the BT lines I've installed have this enabled by default.
  • If you have multiple numbers routed to this PRI you need to tell the PTT you wish to do this and ask them how many digits they will send. 20050602, Nick Barnes - Note that enabling CLIP (Caller Line Identity Presentation) on the line also has the effect that DDI information is passed to Asterisk (i.e. with 'immediate=no'). Since CLIP is generally a good thing, this is the only feature I order on the line.

See UK Asterisk Details For example configurations for a BT line, or Telewest UK PRI setup details

Peer Equipment Variations

Asterisk Fujitsu 9600 PRI

Connecting Two Asterisk Through PRI


Here's how to connect two asterisk PBXs together using Zaptel PRI ISDN. And here's another webpage on how to do the same using Dahdi PRI ISDN.




  1. 2005-05-26, mjm, page started
  2. 2005-05-26, tp, zaptel PRI troubleshooting notes, UK service provider info gathering notes
  3. 2005-05-26, jt, use asterisk@home for setup
  4. 2005-06-02, nab, Added some UK specific hints
Created by: mikem, Last modification: Sat 16 of Jun, 2012 (09:08) by admin
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+