isdnd communicates with the kernel part of isdn4bsd by receiving status and event messages (via
read(2) from device
/dev/isdn) and by transmitting commands and responses (via
ioctl(2) on device
/dev/isdn).
The messages and message parameters are documented in the include file
/usr/include/machine/i4b_ioctl.h.
Supported command and response messages (ioctl's) to the kernel are:
I4B_CDID_REQ
Request a unique Call Description IDentifier (cdid) which identifies uniquely a single interaction of the local D channel with the exchange.
I4B_CONNECT_REQ
Actively request a call setup to a remote ISDN subscriber.
I4B_CONNECT_RESP
Respond to an incoming call, either accept, reject or ignore it.
I4B_DISCONNECT_REQ
Actively terminate a connection.
I4B_CTRL_INFO_REQ
Request information about an installed ISDN controller card.
I4B_DIALOUT_RESP
Give information about call setup to driver who requested dialing out.
I4B_TIMEOUT_UPD
Update the kernels timeout value(s) in case of dynamically calculated shorthold mode timing changes.
I4B_UPDOWN_IND
Inform the kernel userland drivers about interface soft up/down status changes.
I4B_CTRL_DOWNLOAD
Download firmware to active card(s).
I4B_ACTIVE_DIAGNOSTIC
Return diagnostic information from active cards.
Supported status and event messages from the kernel are:
MSG_CONNECT_IND
An incoming call from a remote ISDN user is indicated.
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.
MSG_DISCONNECT_IND
A call was terminated.
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).
MSG_IDLE_TIMEOUT_IND
A call was terminated by the isdn4bsd kernel driver because a B-channel idle timeout occurred.
MSG_ACCT_IND
Accounting information from a network driver.
MSG_CHARGING_IND
Charging information from the kernel.
OUTGOING CALLS
Currently the only possibility to trigger an outgoing call is that an isdn4bsd network driver (
isdn<n>) sends a
MSG_DIALOUT_IND to the
isdnd daemon.
The daemon requests a new CDID from the kernel by using the
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.
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
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
MSG_CONNECT_ACTIVE_IND to the daemon.
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
I4B_DISCONNECT_REQ ioctl message, both events are signaled to the
isdnd by the kernel sending the
I4B_DISCONNECT_IND message and the CDID corresponding to the call is no longer valid.
INCOMING CALLS
Incoming calls are signaled to
isdnd by the kernel transmitting the
MSG_CONNECT_IND message to the daemon.
With the information contained in this message,
isdnd 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
I4B_CONNECT_RESP ioctl message with the appropriate parameters to the kernel.
In case the daemon decided to accept the call, the kernel signals this by sending a
MSG_CONNECT_ACTIVE_IND message to the daemon.
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
I4B_DISCONNECT_REQ ioctl message, both events are signaled to
isdnd by the kernel sending the
I4B_DISCONNECT_IND message and the CDID corresponding to the call is no longer valid.