(Page 1 of 1 in this chapter) Version


Chapter 4

BRI Service Call Control


4.1 Introduction
4.2 Call Control Operations Supported By the BRI Service
4.3 Call Control API Summary
4.3.1 Call Control Functions
4.4 Inbound Calls
4.4.1 Retrieving Call Information
4.4.2 Answering the Call
4.4.3 Rejecting the Call
4.4.4 Accepting the Call Without Answering
4.5 Outbound Calls
4.5.1 Initiating an Outbound Call
4.5.2 Outbound Call Events
4.6 Releasing a Call
4.6.1 Network-Initiated Call Release
4.6.2 Application-Initiated Call Release
4.7 Blocking and Unblocking Calls
4.7.1 Blocking Calls
4.7.2 Unblocking Calls
4.8 Sending and Receiving User-to-User Information (UUI)
4.8.1 Sending UUI
4.8.2 Receiving UUI

4.1 Introduction

This chapter:

4.2 Call Control Operations Supported By the BRI Service

The BRI service supports the following call control operations:

Operation

Supported?

For more information, refer to...

Receiving inbound calls

Yes

Section 4.4

Placing outbound calls

Yes

Section 4.5

Releasing calls

Yes

Section 4.6

Call blocking

Yes

Section 4.7

Call transfer

No

N/A

4.3 Call Control API Summary

This section summarizes the BRI service functions needed to perform call control. For most of these function calls, one or more events are expected in response to the command. These events are also described in this section.

The following table explains where you can obtain more information about the functions, events, and parameters discussed in this chapter:
For more information about the...

Refer to ...

Functions

Chapter 6

Events

Appendix C

Parameters

Appendix D

4.3.1 Call Control Functions

The following table lists call control-related functions and associated events:
Function

Description/Associated Events

briAcceptCall

Directs the ISDN stack to accept an incoming call without answering it. The application can then perform other operations before answering or rejecting the call.

Associated Events:

· BRIEVN_ACCEPTING_CALL: The ISDN stack is accepting the call. An ALERTING message is sent to the network.

· BRIEVN_CALL_DISCONNECTED: A DISCONNECT message was received from the network, indicating that the remote party has hung up. The event value field contains the reason.

briAnswerCall

Directs the ISDN stack to answer a call immediately.

Associated Events:

· BRIEVN_ANSWERING_CALL: A CONNECT message is sent to the network.

· BRIEVN_CALL_CONNECTED: The CONNECT message was acknowledged by the network, and the connection is established.

· BRIEVN_CALL_DISCONNECTED: A DISCONNECT message was received from the network, indicating that the remote party has hung up. The event value field contains the reason.

· BRIEVN_STATUS_UPDATE: Asynchronous information regarding the call (UUI information) has arrived. The event value field contains the information type.

briBlockCalls

Requests the BRI service to block all incoming calls and outgoing calls. The line remains in the blocked state until briUnBlockCalls is called.

Associated Events:

· BRIEVN_CALLS_BLOCKED: Returns when the request has been granted.

briGetCallStatus

Retrieves call status information.

Associated Events: None.

briPlaceCall

Directs the ISDN stack to place a call to a specified number.

Associated Events:

· BRIEVN_PLACING_CALL: This informational event is generated after the trunk has been seized, and an acknowledgement has been received from the network. (This implies that glare has been resolved.) The network is sent a SETUP message.

This event also indicates that a B channel has been chosen for the call. The stream and timeslot for this B channel can be determined by calling briGetCallStatus.

· BRIEVN_CALL_PROCEEDING: This low-level event is enabled only if the BRI_CC_REPTPROCEEDING bit is set in the BRI_START_PARMS eventmask passed to briStartProtocol (refer to the source code for briswi for an example). This event follows BRIEVN_PLACING_CALL.

· BRIEVN_REMOTE_ALERTING: This low-level event is enabled only if the BRI_CC_REPTALERTING bit is set in the BRI_START_PARMS eventmask passed to briStartProtocol (refer to the source code for briswi for an example). It means that the network has sent an ALERTING message, indicating that the remote party is being alerted of the call, or that a ring back tone has been detected.

· BRIEVN_REMOTE_ANSWERED: This low-level event is enabled only if the BRI_CC_REPTANSWERED bit is set in the BRI_START_PARMS eventmask passed to briStartProtocol (refer to the source code for briswi for an example). It means that the network has sent a CONNECT message, indicating that the remote party has answered.

· BRIEVN_CALL_CONNECTED: The call has been established. This occurs when a CONNECT message is received by the network. The application can now play and record voice files, generate and detect DTMF tones, etc.

· BRIEVN_CALL_DISCONNECTED: The call could not be placed. This occurs when a DISCONNECT message is received from the network.

· BRIEVN_INCOMING_CALL: A call is arriving on the B channel. Call placement is aborted. This message occurs when a SETUP message is received.

· BRIEVN_STATUS_UPDATE: Asynchronous information regarding the call (UUI information) has arrived. The event value field contains the information type.

briRejectCall

Directs the ISDN stack to reject an incoming call immediately.

Associated Events:

· BRIEVN_REJECTING_CALL: The reject sequence has started.

· BRIEVN_CALL_DISCONNECTED: A RELEASE message has been received from the network.

· BRIEVN_STATUS_UPDATE: Asynchronous information regarding the call (UUI information) has arrived. The event value field contains the information type.

briReleaseCall

Directs the ISDN stack to perform one of the following actions: initiate connection teardown, abandon call placement, or acknowledge a network disconnect event.

Associated Events:

· BRIEVN_CALL_RELEASED: The call has been released. A DISCONNECT message was sent to the network, and a RELEASE message was received.

· BRIEVN_CALL_DISCONNECTED: A disconnect occurred while the release is taking place. This means that a DISCONNECT message has been received from the network. A RELEASE message is sent in response, terminating the call.

· BRIEVN_STATUS_UPDATE: Asynchronous information regarding the call (UUI information) has arrived. The event value field contains the information type.

briSetExtendedArgs

Sets new arguments for the call control function that immediately follows it.

Associated Events: None.

briStartProtocol

Starts the ISDN protocol.

Associated Events:

· BRIEVN_STARTPROTOCOL_DONE: The function has finished. The event value field indicates if the protocol started successfully.
CTA_REASON_ FINISHED means a successful completion. Any other value implies an error.

briStopProtocol

Stops the ISDN protocol.

Associated Events:

BRIEVN_STOPPROTOCOL_DONE: Indicates that the protocol has been halted. The value field is set to CTA_REASON_FINISHED.

briUnBlockCalls

Requests the BRI service to stop blocking calls.

Associated Events:

· BRIEVN_CALLS_UNBLOCKED: The request to unblock the line is granted.

4.4 Inbound Calls

This section describes how a typical BRI service call control application receives and processes calls, once it has been initialized as described in Chapter 3.

The following is a summary of the steps to establishing an inbound call:

  1. The network offers the call.

    
    
  2. The application takes one of the following actions:
    Action

    What Happens

    It answers the call, by invoking briAnswerCall.

    The call is immediately connected.

    It rejects the call, by invoking briRejectCall.

    The call is immediately cleared.

    It accepts the call without answering, by invoking briAcceptCall.

    The BRI service accepts the call, but the call is not connected yet. The application can then invoke briAnswerCall or briRejectCall as needed.

Figure 9 is a state diagram for inbound calls. The sequence diagrams on the following pages can be correlated with this diagram to gain a comprehensive understanding of the inbound call states and events.

Figure 9. Inbound Call State

4.4.1 Retrieving Call Information

When the network first sends a SETUP message, the ISDN stack handles the setup of an incoming call, and collects incoming digits (including ANI and subaddress digits), and other setup information. When all initial phases of call setup are complete, and the digits and other setup information are available, a BRIEVN_INCOMING_CALL event is generated.

The application must call briGetCallStatus to retrieve the digits (calledaddr and callingaddr) and other information (stream and timeslot). For more information about the stream and timeslot, refer to the BX 2000 Installation and Developer's Manual. The call status information is stored in the BRI_CALL_STATUS data structure:

typedef struct
{ DWORD size; /* Size returned by briGetCallStatus */
DWORD state; /* Call states (BRI_CC_STATE_xxx) */
INT32 reason; /* Reason for going back to IDLE state */
char calledaddr [BRI_MAX_DIGITS+1];
/* DNIS info, called number */
/* (null-terminated string) */
char callingaddr[BRI_MAX_DIGITS+1];
/* ANI info, calling number */
/* (null-terminated string) */
DWORD pendingcommand; /* Current unacknowledged command */
char usercategory; /* User category of the calling party */
/* (for future use) */
char tollcategory; /* Toll category. Generally, same as */
/* usercategory (for future use) */
BYTE stream; /* MVIP address of B channel */
BYTE timeslot; /* MVIP address of B channel */
WORD billingrate; /* Billing rate of the call */
/* (for future use) */
char callednumplan; /* Q.931 numbering plan ID of */
/* called number */
char callednumtype; /* Q.931 number type of */
/* called number */
char callingnumplan; /* Q.931 numbering plan ID of */
/* calling number */
char callingnumtype; /* Q.931 number type of calling number */
char callingpres; /* Caller ID presentation indicator */
char callingscreen; /* Q.931 ANI screening indicator */
char progressdescr; /* Progress descriptor */
char releasecause; /* Cause for call release */
WORD service; /* Service for the current call */
char UUI[BRI_MAX_UUI]; /* UUI message received */
} BRI_CALL_STATUS;
Refer to briGetCallStatus in Chapter 6 for a description of the fields in the BRI_CALL_STATUS structure.

4.4.2 Answering the Call

To immediately answer the call, the application calls briAnswerCall.

The following events are associated with briAnswerCall:
Event

Description

BRIEVN_ANSWERING_CALL

A CONNECT message is sent to the network.

BRIEVN_CALL_CONNECTED

Indicates that the CONNECT message has been acknowledged by the network, and the connection is established.

BRIEVN_CALL_DISCONNECTED

Occurs if a DISCONNECT message is received from the network, indicating that the remote party has hung up.

BRIEVN_STATUS_UPDATE

Asynchronous information regarding the call (UUI information) has arrived. The event value field contains the information type.

Figure 10 is a sequence diagram for answering an inbound call. This diagram depicts the normal exchange of commands and events among the network, the BRI service, CT Access, and the application.

Figure 10. Sequence Diagram for Answering Inbound Call

4.4.3 Rejecting the Call

To reject the call, the application can call briRejectCall. It causes the ISDN protocol stack to actively clear a rejected call by sending a RELEASE message. No tone is played.

The following events are associated with briRejectCall:
Event

Description

BRIEVN_REJECTING_CALL

The ISDN stack is rejecting the call.

BRIEVN_CALL_DISCONNECTED

Occurs when the RELEASE message is received from the network. Call rejection is completed.

BRIEVN_STATUS_UPDATE

Asynchronous information regarding the call (UUI information) has arrived. The event value field contains the information type.

Figure 11 illustrates rejection of an inbound call:

Figure 11. Sequence Diagram for Rejecting Inbound Call

4.4.4 Accepting the Call Without Answering

An application can accept an inbound call without answering, by calling briAcceptCall. briAcceptCall directs the ISDN stack to accept an incoming call without answering it. In response to this function call, the ISDN protocol stack sends an ALERTING message on the trunk. No further action is taken until the application calls briAnswerCall or briRejectCall, or the remote party disconnects.

The following events are associated with briAcceptCall:
Event

Description

BRIEVN_ACCEPTING_CALL

The BRI service has accepted the call, and is waiting for further instructions from the application.

BRIEVN_CALL_DISCONNECTED

The remote party has disconnected.

Figure 12 illustrates accepting an inbound call and then rejecting it:

Figure 12. Sequence Diagram for Accepting and then Rejecting Inbound Call


Note:  When accepting and then rejecting a call, the remote party may first receive a ring back tone (when the call is accepted) and then a busy tone (when the call is rejected).

Figure 13 illustrates accepting an inbound call and then answering it:

Figure 13. Sequence Diagram for Accepting and then Answering Inbound Call

4.5 Outbound Calls

This section describes how a typical BRI service call control application places calls, once it has been initialized as described in Chapter 3.

Once the ISDN protocol is started on the CTA context with briStartProtocol, the application can place outgoing calls. Outbound calls are established as follows:

  1. The application invokes briPlaceCall.

    
    
  2. The ISDN stack causes a SETUP message to be sent to the network. This message contains the information necessary to place the call.

    
    
  3. If the network does not accept the call placement, the BRI service abandons it and sends a BRIEVN_CALL_DISCONNECTED event.

    
    If the network accepts the call, it sends a call proceeding message.
  4. After the call proceeding message has been sent, the BRI service generates a BRIEVN_PLACING_CALL event.

    
    It then waits for the remote party to accept or reject the call.
  5. If a network connection is established, the BRI service generates a BRIEVN_CALL_CONNECTED event.

    
    
  6. If the call request is rejected by the network (e.g., a DISCONNECT message from the network), the BRI service abandons call placement.

Figure 14 is a state diagram for placing outbound calls. This diagram can be correlated with the sequence diagram in Figure 15 to gain an understanding of outbound call states and events.

Figure 14. Outbound Call State Diagram


Figure 15 is a sequence diagram depicting, at several levels, the command and event interchange for placing an outbound call.

Figure 15. Sequence Diagram for Outbound Call

4.5.1 Initiating an Outbound Call

To initiate an outbound call, the application calls briPlaceCall. This function tells the BRI service to deliver a digit string to the network switch. Refer to briPlaceCall in Chapter 6 for more information about how the BRI service expects the digit string to be formatted.

4.5.2 Outbound Call Events

The following events are generated while the call is being set up:
Event

Description

BRIEVN_PLACING_CALL

This informational event is generated after the ISDN stack has seized the trunk, and an acknowledgement has been received from the network. (This implies that glare has been resolved and that the digit string has been delivered.)

This event also indicates that a B channel is now available. At this point, the application should determine which outbound channel has been assigned to the call, and connect this channel to the CTA context. The stream and timeslot corresponding to this channel can be determined by calling briGetCallStatus. For more information, refer to Section 4.4.1, Retrieving Call Information.

BRIEVN_CALL_PROCEEDING

This is a low-level event which is enabled only if the BRI_CC_REPTPROCEEDING bit is set in the BRI_START_PARMS eventmask passed to briStartProtocol (refer to briswi in Chapter 7 for an example of this). With the BRI service, this event will immediately follow BRIEVN_PLACING_CALL, because, in addition to glare resolution, the digits have been delivered to the network.

BRIEVN_REMOTE_ALERTING

This is a low-level event which is enabled only if the BRI_CC_REPTALERTING bit is set in the BRI_START_PARMS eventmask passed to briStartProtocol (refer to briswi in Chapter 7 for an example of this). It means that the network has sent an ALERTING message indicating that the remote party is being alerted of the call, or that ring back tone has been detected.

BRIEVN_REMOTE_ANSWERED

This is a low-level event which is enabled only if the BRI_CC_REPTANSWERED bit is set in the BRI_START_PARMS eventmask passed to briStartProtocol (refer to briswi in Chapter 7 for an example of this). It means that the network has sent a CONNECT message, indicating that the remote party has answered.

BRIEVN_CALL_CONNECTED

This event indicates that the connection has been established. This happens when a CONNECT message is received by the network. The application can now play and record voice files, generate and detect DTMF tones, etc.

BRIEVN_CALL_DISCONNECTED

This event indicates that the call is disconnected because a release event has been received from the network.

BRIEVN_INCOMING_CALL

A call is coming in on the B channel. The call placement is aborted. This message results from the receipt of a SETUP message.

4.6 Releasing a Call

In order for the BRI service to release a call, both the application and the network must actively release it. The network can disconnect at any time, regardless of the call control state.

After the call is released by both the network and the application, the BRI service generates a BRIEVN_CALL_RELEASED event. If media functions are used, more DSP-related events can be generated on the CTA context since the media functions are not related to call control functions. Therefore, the application must also stop media functions before being eligible to receive and place new calls.

The next two sections present procedures for network-initiated call releases and application-initiated call releases.

4.6.1 Network-Initiated Call Release

To release a call in response to a network disconnect:

  1. The network sends a DISCONNECT message.

    
    
  2. The ISDN stack responds by sending a RELEASE message to the network.

    
    
  3. The network responds with RELEASE COMPLETE.

    
    
  4. The BRI service generates a call disconnected event, BRIEVN_CALL_DISCONNECTED.

    
    Note:  All active operations that use DSP resources must be terminated by the application, which must wait until the DONE events are generated.
    
    To retrieve the ISDN release cause, call briGetCallStatus.
    
    
  5. In response to BRIEVN_CALL_DISCONNECTED, the application invokes briReleaseCall.

    
    
  6. The BRI service generates a call released event, BRIEVN_CALL_RELEASED.

    
    
  7. When the application processes the event, its internal state is reset to idle.

The application is now eligible to place and receive new calls.

Figure 16 is a sequence diagram depicting the command and event interchange for a network-initiated release:

Figure 16. Sequence Diagram for Network-Initiated Release

4.6.2 Application-Initiated Call Release

Application-initiated call release is a one-step process. To release a call from within an application:

  1. The application invokes briReleaseCall.

    
    
  2. In response to briReleaseCall, the ISDN stack sends a DISCONNECT message to the network.

    
    
  3. When the network responds with a RELEASE message, the ISDN protocol stack responds with a RELEASE COMPLETE message, and causes the BRI service to generate a call released event, BRIEVN_CALL_RELEASED.

    
    
  4. When the application processes the event, its internal call state is reset to idle.

    
    Note:  All active operations that use DSP resources must be terminated, and the DONE events should be received.
    
The application is now eligible to place and receive new calls.

Figure 17 is a sequence diagram depicting the command and event interchange for an application-initiated release:

Figure 17. Sequence Diagram for Application-Initiated Release

4.7 Blocking and Unblocking Calls

The BRI service provides the capability for the application to block incoming calls and prevent placement of outbound calls. While calls are being blocked, no call control events are generated.

4.7.1 Blocking Calls

The application blocks calls by invoking briBlockCalls from any call control state. Blocking only takes effect in the call Idle state. If the call control state is not Idle, blocking is deferred until the call is released. When the BRI service begins blocking calls, the application will no longer receive any call control events or be allowed to place any outbound calls.

The BRI service supports only the "reject all incoming calls" blocking method. The BRI service behaves as though the application has pre-responded to each call with briRejectCall.

When blocking calls on a specific CTA context, you only inhibit two calls handled at the same time on the trunk (no timeslot is specifically blocked by this command since the BRI service only supports non-exclusive channel assignment). For example, two CTA contexts (A and B) have been opened on Trunk 1. If you block CTA context A using briBlockCalls, you may receive or place calls only on CTA context B. The B channel (or timeslot) assigned to these calls may be either the timeslot 0 or the timeslot 1. If you want to block the entire trunk, you must block calls on all of the CTA contexts opened on this trunk.

When the BRI service begins blocking calls, the BRIEVN_CALLS_BLOCKED event is generated.

4.7.2 Unblocking Calls

To unblock calls, invoke briUnBlockCalls.

When briUnBlockCalls is executed, the BRIEVN_CALLS_UNBLOCKED event is generated, the call control state returns to Idle, and new calls may be established.

4.8 Sending and Receiving User-to-User Information (UUI)

This section discusses sending and receiving user-to-user information (UUI).

4.8.1 Sending UUI

An application can send user-to-user information during call establishment with briPlaceCall.

The information is sent when the function call is made. Only text UUI is supported.

To specify the information to be sent, the application calls briSetExtendedArgs, specifying the UUI to be sent.

The user-to-user information is sent when the next call to briPlaceCall is made. The BRI service will get the new arguments from the data structures, save them internally, and pass them to the board when the next call control function is called.

For more information about extended call control arguments, refer to Chapter 6.

4.8.2 Receiving UUI

When UUI is received, a BRIEVN_STATUS_UPDATE event is generated. This event is generated depending upon the eventmask value in the BRI_START_PARMS structure when calling briStartProtocol. Refer to Appendix D for more information about the eventmask. The value field contains CALL_STATUS_UUI. The UUI information is available in the BRI_CALL_STATUS structure.



(Page 1 of 1 in this chapter) Version


tech_support@nmss.com
Copyright © 1999, Natural MicroSystems, Inc. All rights reserved.