# Handling D channel failure

When the primary D channel fails, B channel signaling information carried by the channel is transferred to the backup D channel. When a transition occurs, most stable calls (those calls in the active or connected states) can be preserved, although message-associated user-to-user information (MA-UUI) and both call-associated and non-call-associated temporary signaling connections may be lost. There is a small interval (controlled by timer T309) after a failure of the LAPD link before the B channels are removed from service.

If the primary D channel fails and timer T309 is enabled (the t309 parameter in the ISDN_PROTOCOL_PARMS_Q931CC structure is set to 1), any calls that are in the connected state at the time of the failure are preserved. Any calls that are initiated but have not entered the connected state are cleared.

Each cleared call receives:

- ACU_CLEAR_CO (ACU stack mode), or

- NCCEVN_CALL_DISCONNECTED (channelized stack mode).

If the primary D channel fails and timer T309 is disabled (the t309 parameter is set to 0), all initiated calls on both terminal and network sides are cleared with ACU_CLEAR_CO or NCCEVN_CALL_DISCONNECTED messages.

After the data link is reestablished on the backup D channel, the application can start placing and receiving new calls. If the data link on the backup D channel cannot be established, the stack keeps trying to establish the link until one of the D channel's connections is reestablished.

A situation may arise when the primary D channel fails, and one side of a call in the connected state initiates the disconnect process (leaves the connected state) immediately before the data link failure is detected in the system. At the moment of failure recognition, one side is in the connected state, while the side that started the disconnect sequence is not in the connected state. In this case, the state of the first side is preserved. The second side receives an ACU_CLEAR_CO or NCCEVN_CALL_DISCONNECTED message. When the data link is reestablished, the first side remains in the connected state. The application disconnects and releases this call.

A similar situation can arise if the primary D channel fails and both sides are in the connected state (and their states are preserved), but then one side initiates the disconnect process and gets cleared before the data link is reestablished. As a result, when the data link is reestablished, one side remains in the connected state and does not know that the other side has disconnected. The application detects this situation, disconnects, and releases the call.

Since neither D1 nor D2 can serve as a B channel while designated as a backup D channel, an application is not allowed to place a call on a timeslot on a primary or backup channel. Both D1 and D2 channels are assigned to the slots number 24 on the corresponding trunks, so that the maximum B channel slot number for a trunk with a primary or a backup D channel is 23. If the application attempts to place a call on a D channel timeslot, the application receives ACU_CLEAR_CO or NCCEVN_CALL_DISCONNECTED with the cause Acu_clear_co_network_cause = f0: ACU_CAUSE_ACU_BAD_ADDRESS.