# Non-exclusive mode (preferred mode)

When a TCP instance places a call in non-exclusive mode, it requests the use of its default channel from the network. The network allows the use of the default channel or directs the TCP to use a different channel. If a different channel is assigned, the application must perform switching to route the call to the DSP resource associated with the TCP instance.

To do so, the application must:

- Determine which B channel is chosen by the network for the TCP (for example, the default channel or another channel). If no channel is available, the call is rejected by the network.
  When the application receives the NCCEVN_PLACING_CALL event, the stream and timeslot corresponding to the channel are available in the NCC_ISDN_EXT_CALL_STATUS structure. To access the stream and timeslot, invoke nccGetExtendedCallStatus.

- Connect the stream and timeslot for that channel with the stream and timeslot assigned to the context on which the call is placed.
  To perform this connection, the application can use the NaturalAccess Switching API. The switching should be performed as soon as possible after NCCEVN_PLACING_CALL is received, to ensure that call progress analysis succeeds. For an example of applications that perform this switching, see the isdnncc sample program.

For example, if a TCP attempts to establish an outbound call on its default B channel, the default channel is 5, corresponding to MVIP-95 0:4,1:4. The network indicates that channel 5 is not available, but channel 9 is available (corresponding to MVIP-95 0:8,1:8). Since the TCP is running in non-exclusive mode, the call is established on channel 9. The application must now connect the TCP instance's DSP resource (MVIP-95 16:4, 17:4) with the B channel to establish the voice path (for example: 0:8 => 17:4, 16:4 => 1:8). In MVIP-90 terms, this connection is 16:8 <=> 18:4.

Incoming calls from any B channel are routed to the TCP instance unless the B channel on which the call is located is assigned to another TCP running in exclusive mode. For details, see Switching considerations for disconnect handling.

To set a TCP instance to exclusive mode, set the NCC.ADI_ISDN.START_EXT.exclusive parameter to 1.

## Switching considerations for disconnect handling

In non-exclusive mode, when a call is disconnected the application must disconnect only the trunk-to-DSP side of the full duplex switching connection that it made when the call was established. The DSP-to-trunk connection must not be disconnected because it may interfere with a new call arriving on the B channel that is handled by another thread or process.

Disconnecting the trunk-to-DSP connection ensures that if a new outgoing call is placed on the context, any call progress analysis functions receive only silence until the application makes a new connection.