freebsd-dev/usr.sbin/i4b/isdnd/isdnd.8
2000-12-27 15:30:30 +00:00

421 lines
12 KiB
Groff

.\"
.\" Copyright (c) 1997, 2000 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: [Tue May 2 13:45:12 2000]
.\"
.Dd May 2, 2000
.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 demon 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.
.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
.Pp
.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 /dev/i4b ) and by transmitting commands and responses (
.Xr ioctl 2
from device /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 (ioctl's) 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 site 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 site 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
.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/ttyv03 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 syslogd 8 ,
.Xr isdntrace 8 ,
.Xr isdntel 8 ,
.Xr isdnd.rc 5 ,
.Xr isdnd.rates 5 ,
.Xr i4bisppp 4 ,
.Xr i4bipr 4
.Xr i4bing 4
.Sh BUGS
Still one or more left.
.Sh AUTHORS
The
.Nm
daemon and this manual page were written by
.An Hellmuth Michaelis Aq hm@kts.org .