1 \subsection{Introduction}
3 This package contains the mISDN Channel Driver for the Asterisk PBX. It
4 supports every mISDN Hardware and provides an interface for Asterisk.
11 \item BRI and PRI (with BNE1 and BN2E1 Cards)
12 \item Hardware bridging
13 \item DTMF detection in HW+mISDNdsp
14 \item Display messages on phones (on those that support it)
16 \item HOLD/RETRIEVE/TRANSFER on ISDN phones : )
17 \item Allow/restrict user number presentation
19 \item Crypting with mISDNdsp (Blowfish)
20 \item Data (HDLC) callthrough
21 \item Data calling (with app\_ptyfork +pppd)
22 \item Echo cancellation
27 \subsection{Fast Installation Guide}
29 It is easy to install mISDN and mISDNuser. This can be done by:
31 \item You can download latest stable releases from \url{http://www.misdn.org/downloads/}
33 \item Just fetch the newest head of the GIT (mISDN project moved from CVS)
34 In details this process described here: \url{http://www.misdn.org/index.php/GIT}
38 then compile and install both with:
45 (you will need at least your kernel headers to compile mISDN).
52 Now you can compile chan\_misdn, just by making Asterisk:
56 ./configure && make && make install
61 Follow the instructions in the mISDN Package for how to load the Kernel
62 Modules. Also install process described in \url{http://www.misdn.org/index.php/Installing_mISDN}
64 \subsection{Pre-Requisites}
66 To compile and install this driver, you'll need at least one mISDN Driver and
67 the mISDNuser package. Chan\_misdn works with both, the current release version
68 and the development (svn trunk) version of Asterisk.
70 You should use Kernels $>$= 2.6.9
73 \subsection{Configuration}
75 First of all you must configure the mISDN drivers, please follow the
76 instructions in the mISDN package to do that, the main config file and config
80 /etc/init.d/misdn-init and
84 Now you will want to configure the misdn.conf file which resides in the
85 Asterisk config directory (normally /etc/asterisk).
87 \subsubsection{misdn.conf: [general]}
88 The misdn.conf file contains a "general" subsection, and user subsections which
89 contain misdn port settings and different Asterisk contexts.
91 In the general subsection you can set options that are not directly port
92 related. There is for example the very important debug variable which you can
93 set from the Asterisk cli (command line interface) or in this configuration
94 file, bigger numbers will lead to more debug output. There's also a trace file
95 option, which takes a path+filename where debug output is written to.
97 \subsubsection{misdn.conf: [default] subsection}
99 The default subsection is another special subsection which can contain all the
100 options available in the user/port subsections. The user/port subsections inherit
101 their parameters from the default subsection.
103 \subsubsection{misdn.conf: user/port subsections}
105 The user subsections have names which are unequal to "general". Those subsections
106 contain the ports variable which mean the mISDN Ports. Here you can add
107 multiple ports, comma separated.
109 Especially for TE-Mode Ports there is a msns option. This option tells the
110 chan\_misdn driver to listen for incoming calls with the given msns, you can
111 insert a '*' as single msn, which leads to getting every incoming call. If you
112 want to share on PMP TE S0 with Asterisk and a phone or ISDN card you should
113 insert here the msns which you assign to Asterisk. Finally a context variable
114 resides in the user subsections, which tells chan\_misdn where to send incoming
115 calls to in the Asterisk dial plan (extension.conf).
118 \subsubsection{Dial and Options String}
120 The dial string of chan\_misdn got more complex, because we added more features,
121 so the generic dial string looks like:
125 mISDN/<port>|g:<group>/<extension>[/<OPTIONSSTRING>]
127 The Optionsstring looks Like:
128 :<optchar><optarg>:<optchar><optarg>...
130 the ":" character is the delimiter.
132 The available options are:
133 a - Have Asterisk detect DTMF tones on called channel
134 c - Make crypted outgoing call, optarg is keyindex
135 d - Send display text to called phone, text is the optarg
136 e - Perform echo cancelation on this channel,
137 takes taps as optarg (32,64,128,256)
138 e! - Disable echo cancelation on this channel
139 f - Enable fax detection
140 h - Make digital outgoing call
141 h1 - Make HDLC mode digital outgoing call
142 i - Ignore detected DTMF tones, don't signal them to Asterisk,
143 they will be transported inband.
144 jb - Set jitter buffer length, optarg is length
145 jt - Set jitter buffer upper threshold, optarg is threshold
146 jn - Disable jitter buffer
147 n - Disable mISDN DSP on channel.
148 Disables: echo cancel, DTMF detection, and volume control.
149 p - Caller ID presentation,
150 optarg is either 'allowed' or 'restricted'
151 s - Send Non-inband DTMF as inband
152 vr - Rx gain control, optarg is gain
153 vt - Tx gain control, optarg is gain
157 chan\_misdn registers a new dial plan application "misdn\_set\_opt" when
158 loaded. This application takes the Optionsstring as argument. The Syntax is:
161 misdn_set_opt(<OPTIONSSTRING>)
164 When you set options in the dialstring, the options are set in the external
165 channel. When you set options with misdn\_set\_opt, they are set in the current
166 incoming channel. So if you like to use static encryption, the scenario looks
170 Phone1 --> * Box 1 --> PSTN_TE
171 PSTN_TE --> * Box 2 --> Phone2
174 The encryption must be done on the PSTN sides, so the dialplan on the boxes
179 exten => _${CRYPT_PREFIX}X.,1,Dial(mISDN/g:outbound/:c1)
182 exten => ${CRYPT_MSN},1,misdn_set_opt(:c1)
183 exten => ${CRYPT_MSN},2,dial(${PHONE2})
187 \subsection{mISDN CLI commands}
189 At the Asterisk cli you can try to type in:
195 Now you should see the misdn cli commands:
200 -> pid (cleans a broken call, use with care, leads often
201 to a segmentation fault)
203 -> display (sends a Text Message to a Asterisk channel,
204 this channel must be an misdn channel)
206 -> debug (sets debug level)
208 -> config (shows the configuration options)
209 -> channels (shows the current active misdn channels)
210 -> channel (shows details about the given misdn channels)
211 -> stacks (shows the current ports, their protocols and states)
212 -> fullstacks (shows the current active and inactive misdn channels)
215 -> port (restarts given port (L2 Restart) )
217 - reload (reloads misdn.conf)
221 You can only use "misdn send display" when an Asterisk channel is created and
222 isdn is in the correct state. "correct state" means that you have established a
223 call to another phone (must not be isdn though).
225 Then you use it like this:
227 misdn send display mISDN/1/101 "Hello World!"
229 where 1 is the Port of the Card where the phone is plugged in, and 101 is the
230 msn (callerid) of the Phone to send the text to.
232 \subsection{mISDN Variables}
234 mISDN Exports/Imports a few Variables:
237 - MISDN_ADDRESS_COMPLETE : Is either set to 1 from the Provider, or you
238 can set it to 1 to force a sending complete.
242 \subsection{Debugging and sending bug reports}
244 If you encounter problems, you should set up the debugging flag, usually
245 debug=2 should be enough. The messages are divided into Asterisk and mISDN
246 parts. mISDN Debug messages begin with an 'I', Asterisk messages begin with
247 an '*', the rest is clear I think.
249 Please take a trace of the problem and open a report in the Asterisk issue
250 tracker at \url{http://bugs.digium.com} in the "channel drivers" project,
251 "chan\_misdn" category. Read the bug guidelines to make sure you
252 provide all the information needed.
255 \subsection{Examples}
257 Here are some examples of how to use chan\_misdn in the dialplan
263 OUT_PORT=1 ; The physical Port of the Card
264 OUT_GROUP=ExternE1 ; The Group of Ports defined in misdn.conf
267 exten => _X.,1,Dial(mISDN/${OUT_PORT}/${EXTEN})
268 exten => _0X.,1,Dial(mISDN/g:${OUT_GROUP}/${EXTEN:1})
269 exten => _1X.,1,Dial(mISDN/g:${OUT_GROUP}/${EXTEN:1}/:dHello)
270 exten => _1X.,1,Dial(mISDN/g:${OUT_GROUP}/${EXTEN:1}/:dHello Test:n)
274 On the last line, you will notice the last argument (Hello); this is sent
275 as Display Message to the Phone.
277 \subsection{Known Problems}
279 Q: I cannot hear any tone after a successful CONNECT to the other end.
281 A: You forgot to load mISDNdsp, which is now needed by chan\_misdn for switching
282 and DTMF tone detection.