1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
|
.\"
.\" Copyright (c) 1997, 2001 Hellmuth Michaelis. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id: isdnd.8,v 1.29 2000/05/02 11:50:28 hm Exp $
.\"
.\" $FreeBSD$
.\"
.\" last edit-date: [Wed May 2 10:48:30 2001]
.\"
.Dd May 2, 2001
.Dt ISDND 8
.Os
.Sh NAME
.Nm isdnd
.Nd isdn4bsd ISDN connection management daemon
.Sh SYNOPSIS
.Nm
.Op Fl c Ar configfile
.Op Fl d Ar debuglevel
.Op Fl f
.Op Fl F
.Op Fl l
.Op Fl L Ar logfile
.Op Fl P
.Op Fl r Ar device
.Op Fl s Ar facility
.Op Fl t Ar terminaltype
.Op Fl u Ar charging unit length
.Op Fl m
.Sh DESCRIPTION
.Nm Isdnd
is the isdn4bsd package daemon which manages all ISDN related connection
and disconnection of ISDN devices supported by the package.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl c
Use
.Ar configfile
as the name of the runtime configuration filename for
.Nm
instead of the default file
.Li /etc/isdn/isdnd.rc .
.It Fl d
If debugging support is compiled into
.Nm
this option is used to specify the debugging level, or better which kind
of debugging messages are displayed.
The debugging level is the sum of the
following values:
.Pp
.Bl -tag -width Ds -compact -offset indent
.It Ar 0x001
general debugging.
.It Ar 0x002
rates calculation.
.It Ar 0x004
timing calculations.
.It Ar 0x008
state transitions.
.It Ar 0x010
retry handling.
.It Ar 0x020
dialing.
.It Ar 0x040
process handling.
.It Ar 0x080
isdn4bsd kernel i/o calls.
.It Ar 0x100
controller and channel busy/free messages.
.It Ar 0x200
isdnd.rc configuration file processing.
.It Ar 0x400
outgoing call budget handling.
.It Ar 0x800
valid keyword and holiday file processing.
.El
.Pp
The value can be specified in any number base supported by the
.Xr sscanf 3
library routine.
.Pp
In addition, this option accepts also the character 'n' as an argument to
disable displaying debug messages on the full-screen display.
.Pp
.It Fl f
Specifying this option causes
.Nm
to enter the full-screen mode of operation.
When operating in this mode,
entering the control character
.Em Control-L
causes the display to be refreshed and entering
.Em Carriage-Return
or
.Em Enter
will pop-up a command window.
Because the
.Nm
daemon will not listen to messages while the command window is active,
this command window will disappear automatically after 5 seconds without
any command key press.
.Pp
While the command window is active,
.Em Tab
or
.Em Space
advances to the next menu item.
To execute a command, press
.Em Return
or
.Em Enter
for the highlighted menu item, or enter the number corresponding to the
item to be executed or enter the capitalized character in the menu item
description.
.It Fl l
If this option is set, logging is not done via the
.Xr syslogd 8
facility but instead is appended to a file.
.It Fl L
Specifies the name of the logfile which is used when the option
.Em -l
is set.
See also the keyword
.Em rotatesuffix
in the system section of
.Xr isdnd.rc 5 .
.It Fl P
This option prints out the parsed and verified isdnd configuration in the same
format as the isdnd.rc file.
This output can be used as an isdnd.rc file.
This
feature is especially useful when debugging an isdnd.rc file to see, what the
default settings of options are when they are not set in the isdnd.rc input
file.
.Pp
The
.Nm
exits after the printout is done.
.It Fl F
This option prevents
.Nm
to detach from the controlling tty and become a daemon.
.It Fl r
In conjunction with the
.Fl t
option,
.Ar device
specifies a terminal device which becomes the controlling tty for
.Nm
and on which the full-screen mode output is displayed.
.It Fl s
This option may be used to specify the logging facility in case
.Xr syslog 3
logging is configured and another facility than the default LOCAL0
facility shall be used.
The facility is to be specified as an integer in
the range 0-11 or 16-23 (see the file /usr/include/syslog.h).
.It Fl t
In conjunction with the
.Fl f
and
.Fl r
options,
.Ar terminaltype
specifies a terminal type or termcap entry name (such as vt220) for the device
used for
.Nm
full-screen output.
This is useful if an unused (no getty running) tty line is
used for full-screen output for which no
.Li TERM
environment variable exists.
.It Fl u
Specifies the length of a charging unit in case the config file entry
keyword
.Em unitlenghtsrc
is set to
.Em cmdl .
.It Fl m
If the isdn daemon is compiled with local or remote monitoring support,
this option disables all monitoring access.
It overrides the config
file option
.Em monitor-allowed .
.El
.Sh INTERACTION WITH THE KERNEL
.Nm Isdnd
communicates with the kernel part of isdn4bsd by receiving status and
event messages
.Xr ( read 2
from device
.Pa /dev/i4b )
and by transmitting commands and responses
.Xr ( ioctl 2
from device
.Pa /dev/i4b ) .
.Pp
The messages and message parameters are documented in the include
file
.Em /usr/include/machine/i4b_ioctl.h .
.Pp
Supported command and response messages (ioctls) to the kernel are:
.Bl -tag -width Ds -compact -offset indent
.It Ar I4B_CDID_REQ
Request a unique Call Description IDentifier (cdid) which identifies
uniquely a single interaction of the local D channel with the exchange.
.It Ar I4B_CONNECT_REQ
Actively request a call setup to a remote ISDN subscriber.
.It Ar I4B_CONNECT_RESP
Respond to an incoming call, either accept, reject or ignore it.
.It Ar I4B_DISCONNECT_REQ
Actively terminate a connection.
.It Ar I4B_CTRL_INFO_REQ
Request information about an installed ISDN controller card.
.It Ar I4B_DIALOUT_RESP
Give information about call setup to driver who requested dialing out.
.It Ar I4B_TIMEOUT_UPD
Update the kernels timeout value(s) in case of dynamically calculated
shorthold mode timing changes.
.It Ar I4B_UPDOWN_IND
Inform the kernel userland drivers about interface soft up/down status
changes.
.It Ar I4B_CTRL_DOWNLOAD
Download firmware to active card(s).
.It Ar I4B_ACTIVE_DIAGNOSTIC
Return diagnostic information from active cards.
.El
.Pp
.Pp
Supported status and event messages from the kernel are:
.Bl -tag -width Ds -compact -offset indent
.It Ar MSG_CONNECT_IND
An incoming call from a remote ISDN user is indicated.
.It Ar MSG_CONNECT_ACTIVE_IND
After an incoming call has been accepted locally or an outgoing call has
been accepted by a remote, the exchange signaled an active connection
and the corresponding B-channel is switched through.
.It Ar MSG_DISCONNECT_IND
A call was terminated.
.It Ar MSG_DIALOUT_IND
A userland interface driver requests the daemon to dial out (typically a
network interface when a packet arrives in its send queue).
.It Ar MSG_IDLE_TIMEOUT_IND
A call was terminated by the isdn4bsd kernel driver because a B-channel
idle timeout occurred.
.It Ar MSG_ACCT_IND
Accounting information from a network driver.
.It Ar MSG_CHARGING_IND
Charging information from the kernel.
.El
.Pp
.Ss OUTGOING CALLS
Currently the only possibility to trigger an outgoing call is that an
isdn4bsd network driver
.Em (ipr<n>)
sends a
.Em MSG_DIALOUT_IND
to the
.Nm
daemon.
.Pp
The daemon requests a new CDID from the kernel by using the
.Em I4B_CDID_REQ
ioctl message, this CDID is now used in all interactions with the kernel
to identify this single call until a disconnect occurs.
.Pp
After getting the CDID, the daemon looks up several additional information
in its entry section of the configuration corresponding to that connection
and issues a
.Em I4B_CONNECT_REQ
ioctl message to the kernel.
The kernel now dials the remote side and
if the remote side accepts the call, the kernel sends a
.Em MSG_CONNECT_ACTIVE_IND
to the daemon.
.Pp
The call is terminated by either the local side timing out or the remote
side hanging up the connection or the local side actively sending a
.Em I4B_DISCONNECT_REQ
ioctl message, both events are signaled to the
.Nm
by the kernel sending the
.Em I4B_DISCONNECT_IND
message and the CDID corresponding to the call is no longer valid.
.Pp
.Ss INCOMING CALLS
Incoming calls are signaled to the
.Nm
by the kernel transmitting the
.Em MSG_CONNECT_IND
message to the daemon.
.Pp
With the information contained in this message, the
.Nm
searches the entry section of its configuration database and if a match is
found, it accepts or rejects the call or, if no match is found, it ignores the
call - all by issuing a
.Em I4B_CONNECT_RESP
ioctl message with the appropriate parameters to the kernel.
.Pp
In case the daemon decided to accept the call, the kernel signals this
by sending a
.Em MSG_CONNECT_ACTIVE_IND
message to the daemon.
.Pp
The call is terminated by either the local side timing out or the remote
side hanging up the connection or the local side actively sending a
.Em I4B_DISCONNECT_REQ
ioctl message, both events are signaled to the
.Nm
by the kernel sending the
.Em I4B_DISCONNECT_IND
message and the CDID corresponding to the call is no longer valid.
.Sh SIGNALS
Sending a HUP signal to
.Nm
causes all open connections to be terminated and the configuration file is
reread.
In case aliasfile handling was enabled, the aliasfile is also
reread.
.Pp
Sending a USR1 signal to
.Nm
causes the accounting file and the logfile (if logging to a file is used
instead of logging via the
.Xr syslog 3
facility) to be closed and reopened to make logfile rotation possible.
.Sh ENVIRONMENT
The following environment variables affect the execution of
.Nm :
.Bl -tag -width Ds
.It Ev TERM
The terminal type when running in full-screen display mode.
See
.Xr environ 7
for more information.
.El
.Sh FILES
.Bl -tag -width /etc/isdn/isdnd.rates
.It Pa /dev/i4b
The device-file used to communicate with the kernel ISDN driver subsystem.
.It Pa /var/log/messages
A record of the actions in case of syslogd logging support.
.It Pa /var/log/isdnd.acct
The default accounting information filename (if accounting is configured).
.It Pa /var/log/isdnd.log
The default logging filename (if logging to a file is configured).
.It Pa /var/run/isdnd.pid
The process id of the isdn daemon (also known as "lockfile" to isdnd, preventing multiple invocations of it).
.It Pa /usr/local/lib/isdn
.It Pa /etc/isdn
The directory where isdnd expects some supplementary data files and programs
for telephone answering support.
.It Pa /etc/isdn/isdnd.rc
The default runtime configuration file.
.It Pa /etc/isdn/isdnd.rates
The default unit charging rates specification file.
.It Pa /etc/isdn/isdntel.alias
The default table (if aliasing is enabled) to convert phone number to caller's name.
.El
.Sh EXAMPLES
For a first try, the following command should be used to start
.Nm
in foreground mode for better debugging the configuration setup:
.Bd -literal -offset indent
isdnd -d0xf9 -F
.Ed
.Pp
This will start isdnd with reasonable debugging settings and produce
output on the current terminal.
.Nm Isdnd
can then be terminated by entering Control-C.
.Pp
Another example, the command:
.Bd -literal -offset indent
isdnd -d0xf9 -f -r /dev/ttyv3 -t vt100
.Ed
.Pp
will start
.Nm
with reasonable debugging messages enabled, full-screen mode of operation,
full-screen display redirected to /dev/ttyv3 and using a termcap entry
for vt100 on this display.
.Sh DIAGNOSTICS
Exit status is 0 on success, 1 on error.
.Sh SEE ALSO
.Xr i4bing 4 ,
.Xr i4bipr 4 ,
.Xr i4bisppp 4 ,
.Xr isdnd.rates 5 ,
.Xr isdnd.rc 5 ,
.Xr isdntel 8 ,
.Xr isdntrace 8 ,
.Xr syslogd 8
.Sh BUGS
Still one or more left.
.Sh AUTHORS
The
.Nm
daemon and this manual page were written by
.An Hellmuth Michaelis Aq hm@freebsd.org .
|