This page contains information on how to obtain and get chan_misdn running with asterisk. Also the features and problems of chan_misdn are described.

Note: Alternately, you can use the Linux Call Router and its chan_lcr driver to interface Asterisk to ISDN.
There also seems to be a GIT tree of LCR (for the adventurous!).

Note: chan_misdn does not yet work with the new mISDN code that's included in the Linux kernel (2.6.27). You need chan_lcr if you need to use that.

What is chan_misdn?

chan_misdn was developed by http://www.beronet.com. It is an asterisk channel driver which supports the new modular Isdn for Linux (mISDN) from http://www.misdn.org. chan_misdn is divided in the stable and head branch.
All ISDN cards which are supported in mISDN can be used in Asterisk.
Also the NT supporting HFC-4S0 and HFC-8S0 cards as beroNet's BN4S0, BN8S0 and Digiums B410P can be used.

Which features has chan_misdn ?

  • NT and TE mode
  • PP and PMP mode
  • BRI and PRI
  • Bchannel Hardware Bridging (mqueue)
  • DTMF Detection in HW+mISDNdsp
  • Display Messages to Phones (which support display msg)
  • CLIP
  • CLIP - no screening
  • CLIR
  • mark2, kb1 (mqueue) EchoCancellation
  • Volume Control
  • Crypting with mISDNdsp (Blowfish)
  • Data (HDLC) callthrough
  • Data Call -In (with app_pipe +pppd)
  • Data Call between chan_midsn and chan_zap (http://bugs.digium.com/view.php?id=6251)
  • CallDeflection

Where do i get it?

chan_misdn is now part of asterisk. This means the stable branch of chan_misdn will be automatically obtained by downloading asterisk 1.2, the head branch of chan_misdn is now in the trunk of asterisk.
A guide on how to install mISDN and mISDN user can be found here: Installing mISDN
If you like to use Asterisk 1.0 you can get http://www.beronet.com/downloads/install-misdn.tar.gz which auto-gets all the necessary files and installs them.

How to configure it ?

First of all there are 2 important config files:
  1. /etc/misdn-init.conf (only valid for mISDN versions <1.2)
  2. /etc/asterisk/misdn.conf

this is quite like zaptel.conf/zapata.conf for zaptel devices.
The misdn-init.conf defines which ports have which configuration (NT,TE,PTP,PTMP,CAPI), here you can also define the timing. There is a README.misdn-init and the sample configfile is quite self-explanatory. This file can be generated automatically by:
/etc/init.d/misdn-init config
This script scans the pci space an generates a samples /etc/misdn-init.conf. Loading and unloading the modules (Kernel device drivers) is quite easy:
/etc/init.d/misdn-init start/stop

Now you'll need to configure your misdn.conf. It has 2 Special Sections: general and default. The general section contains configuration parameters which are not port related, like debugging options. The default section contains all the port related configurations.
You can add Portgroups by just creating sections. The Sectionname is the groupname. This section will contain a number of ports and port related configuration options, which will overwrite the default-options for this particular group.
A very simple misdn.conf file could just look like:





Important misdn.conf elements

dialplan - This defaults to 0 which means "unknown" change this to 1 if you have weird issues with PBXs or GWs on a NT Port. Then you'll need to dial in the international format like: <internatprefix><natprefix><localnum>. For example in Berlin: 49301234 (49=internationalprefix, 030=berlin national prefix, 1234=local number)

Changes in version 1.2 of mISDN

Starting with version 1.2 mISDN has a new format and name of its config file.
  1. The start/stop script is now /usr/sbin/mISDN
  2. The filename and path is now /etc/mISDN.conf and is now a xml file
The XML mISDN.conf file for a BN2E1 and a BN8S0 interconnected by a PCM cable, with the BN2E1 receiving the master-clock from the telco, could look like this:

<?xml version="1.0"?>
<module poll="128" debug="0" timer="no" pcm="1,1">hfcmulti</module>
<module debug="0" options="0">mISDN_dsp</module>
<devnode user="root" group="root" mode="644">mISDN</devnode>
<card type="BN2E1" ulaw="yes">
<port mode="te" link="ptp">1</port>
<port mode="nt" link="ptp">2</port>
<card type="BN8S0" ulaw="yes" ignore_pcm_frameclock="yes" pcm_slave="yes">
<port mode="te" link="ptmp">1</port>
<port mode="nt" link="ptmp">2</port>
<port mode="nt" link="ptmp">3</port>
<port mode="nt" link="ptmp">4</port>
<port mode="nt" link="ptmp">5</port>
<port mode="nt" link="ptmp">6</port>
<port mode="nt" link="ptmp">7</port>
<port mode="nt" link="ptmp">8</port>

What else ?

There are a number of applications which work together with chan_misdn:
  • app_waitfordigits - implements an interdigit timeout
  • app_pipe - can start pppd on a misdn channel
  • app_v110 - starts a login on a v110 over isdn misdn channel
You can download the latest version form them at: http://www.beronet.com/downloads/apps/app_bundle.tar.gz

chan_misdn contains 2 builtin functions:
  • misdn_set_opt - sets misdn specific options
  • misdn_facility - sends out facility messages (only in head)

also chan_misdn has a number of cli commands which allow to restart ports and show debugging infos and send display messages to ISDN phones. The most popular are:
  • misdn show stack
  • misdn show channels
  • misdn show config


chan_misdn calls are well supported by the Flash Operator Panel when you use Callerid Buttons.

Special Scenarios

Zaptel to mISDN Data Bridging

ISDN-DATA-Device <---> BRI chan_misdn <---> * <---> chan_zap <----> PSTN <---> ISDN-DATA-END-Device
We have managed to create a patch for chan_zap which enables the possibility of Sending Datacalls from a BRI Card (mISDN) to a PRI Card (zaptel). This patch is available for the trunk of asterisk at: http://bugs.digium.com/view.php?id=6251
We have also backported this patch to asterisk 1.2 in our private svn branch, which can be retrieved via:
svn co http://svn.digium.com/svn/asterisk/team/crichter/0.3.0 asterisk-0.3.0

To enable the data bridging you need to set the "hdlc=yes" options for the ISDN BRI Port where your data device is connected to. But you need to set the zap channel into data mode as well, you do this with:
exten => 123,1,Dial(Zap/g0h/1234)
where the h indicates that the following call will be a data call with hdlc framing. If this works for you please report that on the digium bugtracker, so that this patch can go into the svn of asterisk.


Since mISDN provides a CAPI interface you could also use chan_capi instead of chan_misdn.

Dec. 05 (Asterisk v1.2.1) You explicitly need to load res_features.so before chan_misdn.so so that ast_pickup_call is
exported and available to the module.

kernel timing
Please be warned that using different kernel timing than default (250) will most likely lead to problems. Poll parameter in /etc/misdn_init.conf will have to have different value than given in configuration file comments. Also different poll variable value than ones presented in those comments might lead to slipping frames and asterisk not being able to load chan_misdn.so (if a refernce to configuration file is given in misdn.conf)


Question: Why can't i configure my NT Port in PTP (Point To Point) Mode ?

Answer: mISDN is a very flexible Layer Management System. Since mISDN came from the isdn4linux guys, who only had a TE Stack, the whole TE Stack lives in the Kernel Modules: mISDN_l1. mISDN_l2 and l3udss1. The NT Stack is new, and because new things may be buggy, they have decided to implement the NT stack in the Userspace, so it is implemented in mISDNuser. When all the work has been finished the NT Stack can be moved into a kernel Module. This means: you can configure if a mISDN port is NT or TE by providing the module parameters. The PTP Setting is a L2 Setting, which must be setted in User Space, so in mISDNuser. You can only do this from within chan_misdn, therefore you need to set the PTP Option additionally in the misdn.conf for each port, which needs to be PTP: e.g.:


Hint: In the 0.3.0 Version of chan_misdn, you don't need to set this option anymore, chan_misdn will then parse /etc/misdn-init.conf and find out which ports need to be PTP

Question: What was the dialstring of chan_misdn again ?

Answer: Dial( mISDN/[g:<name>|<port>]/<number>[/<options>]
name - is a port group name, port group names are the section names in the misdn.conf
port - is a isdn port

number - is clear
options - additional options, which allow to modify the outgoing channel behaviour. Please see further info about these in the README provided with chan_misdn

e.g.: Dial(mISDN/g:extern/1234) or Dial(mISDN/2/321)

Question: Why can't i make proper group calls on NT Port Groups?

Answer: It makes not much sense to group multiple NT Ports, if you plan to connect phones to them. The problem is, that chan_misdn does not know on which Port which phone is connected to, so what should chan_misdn do if you try to make a group call on NT Ports (like dial(mISDN/g:NTPorts/111) ? chan_misdn could for example try to dial on the first port (if theres a free channel), then it needed to wait for a timeout, and try on the second port and so on.. but that would take quite long, because chan_misdn needed to wait for timeouts each time. Also multiple phones with the same number could be connected on different ports .. There are numerous other issues with grouping NT Ports (for phones).

So the easiest way is to define a Phone location, not only by its number but also by the isdnport where it's connected to. So if you want to call a phone on port 3 with number 1 just do dial(mISDN/3/1)

Question: How can i dial-in into my box running chan_misdn with a data call (ppp)?

Answer: Dialin works reliable only in the 0.3.0 branch of chan_misdn. You'll need the application app_pipe, which can be gathered at http://www.beronet.com/downloads/apps/app_bundle.tar.gz, unpack and install it. Then do something like that in your dialplan:

exten => 123,1,Pipe(/usr/sbin/pppd|mru|800|mtu|800|notty|noauth|

add more pppd options to the arguments as you wish. The above example works to dialin without a password. The most crucial options are: notty+ mtu/mru<=1000 !

It is also important to tell chan_misdn explicitly to use hdlc coding/decoding for the bchannel. In the 0.3.x branch you can easily do that by setting the option "hdlc=yes" in the misdn.conf for the specific port.

Question: Asterisk stops responding and my syslog is filled with rport queue overflow messages

Answer: We have added a configureable jitterbuffer in 0.3.0. You'll probably need to enable a bit buffering for better performance. Without buffer the voiceframes are sent directly to Asterisk, they might block there and lock mISDN therefore! Before (0.2.x) we had a static not configureable jitterbuffer, so it worked a bit better.

Just add these lines to your general section:


Question: I don't hier a dialtone when i Off Hook my ISDN Phone, what's wrong ?
Answer: chan_misdn supports the asterisk indication tone zone settings since 0.3.0-rc8 or so.. that means you need to configure the file /etc/asterisk/indications.conf, this file needs to be there!

Question: Why does the L1 goes DOWN on my PMP Isdn Link? Or why do i get No free chan even after group call from chan_misdn if dialing out on my PMP Link?
Answer: The telco shuts down the L1 after a while, thats normal, he wants to save power costs. chan_misdn checks in groupcalls if the L1 is UP if not it takes the next port, that's why we can't call out on that group if every L1 is down. You can avoid that problem either by making a call directly on a port like "dial(mISDN/1/1234)" instead of the group call "dial(mISDN/g:out/1234)". Or you can set the pmp_l1_check=no option for that group in the misdn.conf file.
Question: How do i activate CLIP/No Screening with chan_misdn ?
Answer: It is important to set the localdialplan=2 in the misdn.conf, also set the presentation=2 and screening=0 this should do the trick.

Dialplan Examples

DDI (Anlagenanschluss mit Durchwahl)
In the DDI Scenario you have a base number, lets say 1234 and for example 2 Digits for DDI, lets say the 0 is the main number (1234 0). chan_misdn automatically handles overlapdial and direct incoming calls, just create a dialplan for the incoming calls like:

exten => _1234XX,1,Goto(handleDDI)
exten => _1234XX,2,hangup

exten => 12340,1,Goto(handleMain)
exten => 12340,2,hangup

Overlap Dial from internal analog phones (mISDN NT mode with terminal adapter)
If you got the problem that only two digits get passed to * if you dial a number from an analog phone connected to mISDN in NT mode via some terminal adapter
try to insert overlapdial=1 into your misdn.conf


alternatively try this:

Overlap Dial and outgoing calls
Let's now assume you like to use a ISDN Phone and want to make a call on a SIP Provider that does not support overlap dial. Chan_misdn will only wait for the amount of digits you specify in the dialplan, then it will immediately call the dialplan. To prevent the immediate dial you can use the WaitForDigits application provided with the install-misdn-mqueue.tar.gz (can also be found at http://www.beronet.com/downloads/apps/app_bundle.tar.gz).

The failling dialplan will look like:

exten => _XXX.,1,Dial(SIP/provider1/${EXTEN})

A working dialplan will look like:

exten => _XXX.,1,Waitfordigits(4000)
exten => _XXX.,2,Dial(SIP/provider1/${EXTEN})

Waitfordigits will now wait 4 seconds for new dialed digits.

There is a certain Wiki Page which Describes an alternative but also nice way of making DID work with chan_misdn together with asterisk@home: http://www.voip-info.org/wiki/view/Asterisk+DID+mISDN.

Receiving Faxes with Spandsp (AKA setting Options on Incoming and outgoing channels)
Gain Control and Echocancellation might harm your faxreception with spandsp. chan_misdn makes it possible to change the behaviour of each mISDN call shortly before or after it is created directly in the dialplan.
You can do this by the use of the extended dialstring of chan_misdn for outgoing calls, like:

exten => _X.,1,Dial(mISDN/1/12345/!e:vt0)

As you see we provide additional channel Information after the extension. chan_misdn evaluates this information and uses it to configure the outgoing call. !e= disable echocancellation and vt0 = set gaincontrol to 0. As you see you can provide numerous options divided by colons.

For incoming mISDN calls you would use the misdn_set_opt application like:

exten => 1234,1,misdn_set_opt(!e:vt0)
exten => 1234,2,RxFax(/tmp/fax.tif)

The full list of possible values can be seen in the README.misdn file which is included in the chan_misdn source.

Debugging/ Finding Problems

There are several helpful commands and some utilities to help finding problems in the configuration.

Standard Linux Tools to gather information about your Problem

  • Scan the pci bus

The first useful thing is the tool "lspci" with it you can scan your pci bus and check if the card ist installed properly, just use

lspci -v

  • check Kernel Version, interrupt sharing and free memory

There may be problems with different Kernel Versions, to check your version use :

uname -r

Your system might share interrupts between mISDN and other cards, check that with lspci and with:

cat /proc/interrupts

(after the drivers where loaded)

Check your free memory with:

free -h

  • check the modules which are currently installed


shows you all Kernel modules

  • VERY IMPORTANT: check the kernel logs


shows the kernel logs. The Kernel drivers send messages to syslog, you can display the last few messages with dmesg.

mISDN tools and asterisk CLI commands to gather more specific infos

  • misdn-init

After you've installed mISDN successfully, there will be a script "/etc/init.d/misdn-init", you can scan the pci bus with this script by:

/etc/init.d/misdn-init scan

After having made the misdn-init.conf specific configuration and you start the kernel modules with:

/etc/init.d/misdn-init start

There are displayed helpful info, on how the modules are loaded, regarding the module parameters.

  • portinfo

In the chan_misdn distribution there is a nice tool which helps you to gather much more info about mISDN after having the mISDN modules loaded, you need to compile it manually, this is very easy. Assuming your chan_misdn source is in "/usr/src/install-misdn-mqueue/chan_misdn/" you should just issue the following commands:

cd /usr/src/install-misdn-mqueue/chan_misdn/misdn/
make portinfo

Now you can start portinfo and get more info by


The portinfo program is now also in the trunk of asterisk, just do:

cd /usr/src/asterisk/channels/misdn/
make portinfo

to compile and start it from there.

  • debugging in misdn.conf

If you have issues in getting asterisk started with chan_misdn, start asterisk more verbose in the console:

asterisk -cvvvv

Turn on debugging in the misdn.conf by setting the parameter debug to 3:


  • debugging with asterisk logs

Turn on warnings and notices on the console by modifying your /etc/asterisk/logger.conf

You can also stop asterisk to load chan_misdn automatically by using the /etc/asterisk/modules.conf, and load chan_misdn at the asterisk CLI manually to see only the misdn debugs:

CLI> load chan_misdn.so

  • debugging with misdn cli commands

There are a few important CLI commands for debugging certain problems, these are the important ones:

  • misdn show config

Shows you how chan_misdn understood your /etc/asterisk/misdn.conf. You can see the [general] configuration elements and the version of chan_misdn by:

misdn show config 0

You can see the port specific configurations by adding the portnumber

misdn show config 4

You get all configurations with

misdn show config

  • misdn show stacks

If you want to see if the L1 and L2 are UP/DOWN on a port you can use the cli command:

misdn show stacks

There you see also in which mode your port runs, regarding NT/TE PTMP/PTP

  • misdn show channels

If you like to see detailed information about each mISDN call, just do

misdn show channels

There are numerous more things which can be done for debugging and system checking, but i think these where the most important ones.


We will very soon declare the 0.3.0 head branch as stable because of the very important issues. We plan to support quite more Facility features. We want to integrate Zaptel and mISDN Voice/Data Paths. Of course we want to stabilize chan_misdn even more ;)

See also

Store(s) selling Beronet Cards:

Go back to Asterisk

Created by: crich, Last modification: Tue 12 of Jun, 2012 (04:46 UTC) 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+