(Page 1 of 1 in this chapter)


Chapter 5

AG CAS Call Control Functions and Events


5.1 Call Control Functions and Events
5.1.1 Call Control Functions and Solicited Events
5.1.2 Unsolicited Events

5.1 Call Control Functions and Events

This chapter summarizes CT Access call control functions and events supported by CAS protocol TCPs. For more information about call control refer to the ADI Service Developer's Manual.

There are two types of CT Access events associated with call control operations:

The eventmask parameter in the ADI_CALLCTL_PARMS structure dictates whether certain informational call control events are generated. For detailed information about this structure refer to the ADI Service Function Reference Manual.

The following sections show call control operations and events supported by CAS TCPs.

5.1.1 Call Control Functions and Solicited Events

The following table lists ADI service call control functions and associated events. Functions are listed in alphabetical order. For more detailed documentation of the functions, parameters, and events refer to the ADI Service Function Reference Manual.

Function

Description/Associated Events

adiAcceptCall

Directs the TCP to accept an incoming call without answering it. The application can then perform other operations before answering or rejecting the call. The application can accept a call using any of the following methods:

· ADI_ACCEPT_PLAY_RING (works on all trunks)

· ADI_ACCEPT_QUIET (digital trunks only)

· ADI_ACCEPT_USER_AUDIO (digital trunks only)

Associated Events:

· ADIEVN_ACCEPTING_CALL: The TCP is accepting the call, using the specified method.

· ADIEVN_CALL_DISCONNECTED: The remote party hung up while the call was accepted. For all TCPs, if the remote party hangs up at any point during call setup, the reason will be REMOTE_ABANDONED.

· ADIEVN_REJECTING_CALL: (digital trunks only) The application failed to invoke adiAcceptCall within a protocol-specific period of time. The call is automatically rejected. The event value field contains ADI_REJ_HOST_TIMEOUT. When this happens, a tone is played to the network.

adiAcceptIncomingAddress

(digital trunks only)

Directs the TCP to present the incoming call to the application, even if the TCP would normally expect more information.

Note: If the application calls adiAcceptIncomingAddress and the side placing the call hangs up while the TCP is in the process of a compelled sequence (i.e., before the TCP can present ADIEVN_INCOMING_CALL to the application), the TCP sends ADIEVN_PROTOCOL_ERROR to the application with the value set to FALSE_SEIZURE. Upon receiving this event the application should do nothing, but should consider the call setup failed and go back to waiting for the next incoming call.

adiAnswerCall

Directs the TCP to answer a call after a specified number of rings.

Associated Events:

· ADIEVN_ANSWERING_CALL: The TCP is answering the call.

· ADIEVN_CALL_CONNECTED: The telephone network connection is established.

· ADIEVN_CALL_DISCONNECTED: The remote party hung up while the ring tone was being sent. The event value field contains the reason. For all TCPs, if the remote party hangs up at any point during call setup, the reason will be REMOTE_ABANDONED.

· ADIEVN_REJECTING_CALL: (digital trunks only) The application failed to invoke adiAnswerCall within a protocol-specific period of time (this is a race condition). The call is automatically rejected. The event value field contains ADI_REJ_HOST_TIMEOUT.

adiBlockCalls

Directs the TCP to block all incoming calls. The line remains in the blocked state until adiUnBlockCalls is called.

Associated Event:

· ADIEVN_CALLS_BLOCKED: The request has been granted.

adiGetCallStatus

Retrieves the current status of the call (such as caller ID information, if available). It is typically called after ADIEVN_INCOMING_CALL is received, but can also be useful on other occasions.

Associated Events: None.

adiPlaceCall

Directs the TCP to place a call to a specified number, using call placement parameters specified in ADI_PLACECALL_PARMS.

Associated Events:

· ADIEVN_PLACING_CALL: The TCP has seized an outbound trunk and resolved glare, and is dialing the digits.

· ADIEVN_CALL_PROCEEDING: All of the digits have been offered to the telephone network. This is a low-level event which is enabled only if the ADI_CC_REPTPROCEEDING bit is set in the ADI_CALLCTRL_PARMS eventmask passed to adiStartProtocol.

· ADIEVN_REMOTE_ALERTING: The remote party is ringing. This is a low-level event which is enabled only if the ADI_CC_REPTALERTING bit is set in the ADI_CALLCTRL_PARMS eventmask passed to adiStartProtocol.

· ADIEVN_REMOTE_ANSWERED: The remote party has answered.This is a low-level event which is enabled only if the ADI_CC_REPTANSWERED bit is set in the ADI_CALLCTRL_PARMS eventmask passed to adiStartProtocol.

· ADIEVN_CALL_CONNECTED: The call has been answered, and the application has control of the DSPs. It can now play and record voice files, generate and detect DTMF tones. The event value field indicates the reason for achieving the connected state.

· ADIEVN_CALL_DISCONNECTED: The call has been rejected (the line was busy, or the number did not exist), or was never answered (the timer waiting for an answer expired). The event value field contains the reason. For all TCPs, if the remote party hangs up at any point during call setup, the reason will be REMOTE_ABANDONED.

· ADIEVN_STATUSINFO_UPDATE: (digital trunks only) Information has been received regarding the status of the call.

adiPlaceSecondCall

(analog trunks only)

Directs the TCP to place a second call (in preparation for a transfer) via a PBX, Centrex, or Centrex-like switch, to a specified number, using call placement parameters from ADI_PLACECALL_PARMS. It is only valid from the ADI_CC_STATE_CONNECTED state.

Associated Events:

· ADIEVN_PLACING_CALL2: The TCP has seized an outbound trunk and resolved glare, and is dialing the digits.

· ADIEVN_REMOTE_ANSWERED: The second remote party has answered. This is a low-level event which is enabled only if the ADI_CC_REPTANSWERED bit is set in the ADI_CALLCTRL_PARMS eventmask passed to adiStartProtocol (see the source code of inoutcta.c for an example).

· ADIEVN_CALL2_CONNECTED: The call has been answered, and is connected to a new party. The application has control of the DSPs. It can now play and record voice files, generate and detect DTMF tones. The event value field indicates the reason for achieving the connected state. The original call continues to be on hold.

· ADIEVN_CALL2_DISCONNECTED: The call failed (the line was busy, or the number did not exist, or was never answered) and the application is connected to the original caller in the ADI_CC_STATE_CONNECTED state. The event value field contains the reason.

To complete the transfer, call adiReleaseCall, or to return to the original party, call adiReleaseSecondCall.

adiRejectCall

Directs the TCP to reject an incoming call using one of the following methods:

· ADI_REJ_PLAY_RINGTONE (only option on analog trunks)

· ADI_REJ_PLAY_BUSY (digital trunks only)

· ADI_REJ_PLAY_REORDER (digital trunks only)

· ADI_REJ_USER_AUDIO (digital trunks only)

Associated Events:

· ADIEVN_REJECTING_CALL: The reject sequence is initiated, or the application has failed to invoke adiRejectCall within a protocol-specific period of time. The event value field contains the rejection method code, or ADI_REJ_HOST_TIMEOUT if the host timed out.

· ADIEVN_CALL_DISCONNECTED: The remote party has hung up.

adiReleaseCall

Directs the TCP to perform one of the following actions:

· Initiate connection tear down

· Abandon call placement

· Acknowledge a telephone network disconnect event

Associated Event:

· ADIEVN_CALL_RELEASED: The call has been released (hung up).

adiReleaseSecondCall

(analog trunks only)

Directs the TCP to release the second call established with adiPlaceSecondCall. It may also be used to abort the placing of the second call or the transfer of the call (adiTransferCall). It is only valid from the ADI_CC_STATE_CONNECTED2 or ADI_CC_STATE_PLACING_CALL2 states.

Associated Event:

· ADIEVN_CALL2_DISCONNECTED: The second call has been disconnected (the caller hung up).

adiSetBilling

(digital trunks only)

Sets billing information relative to an incoming call (for protocols that support this feature).

Associated Events:

· ADIEVN_BILLING_SET: The billing information was sent to the network. The value field contains the actual call rate.

This event does not indicate whether the requested rate was accepted by the network or not. If the network rejected the request, but did not provide a figure for the rate, the value is set to ADI_BILLINGRATE_DEFAULT.

· ADIEVN_SEQUENCE_ERROR: The TCP was not in a valid state when it received adiSetBilling. The billing rate can be set while the TCP is in the Idle state or the Incoming Call state.

· ADIEVN_CALL_DISCONNECTED: The remote party has hung up during the set billing operation.

· ADIEVN_PROTOCOL_ERROR: The request to set the billing status is not supported by the protocol.

adiStartProtocol

Starts a TCP.

Associated Event:

· ADIEVN_STARTPROTOCOL_DONE: The operation has finished. The event value field describes whether the TCP started successfully. ADI_REASON_FINISHED means a normal completion. Any other value implies an error.

Note: On AG Quad boards using resource management, ADIERR_NOT_ENOUGH_RESOURCES indicates that the adiStartProtocol parameter mediamask was not set to zero. The application must restart the TCP with the mediamask value in the ADICALLCTL_PARMS structure set to zero. Refer to Chapter 4 for further details about starting digital CAS protocols on boards that use resource management.

adiTransferCall

(analog trunks only)

Directs the TCP to transfer a call via a PBX, Centrex, or Centrex-like switch, to a specified number, using call placement parameters from the ADI_PLACECALL_PARMS structure. It is only valid from the ADI_CC_STATE_CONNECTED state.

Associated Events:

· ADIEVN_PLACING_CALL2: The TCP has seized an outbound trunk and resolved glare, and is dialing the digits.

· ADIEVN_CALL_DISCONNECTED: The call has been transferred, the original call is disconnected.

· ADIEVN_REMOTE_ANSWERED: The second remote party has answered. This is a low-level event which is enabled only if the ADI_CC_REPTANSWERED bit is set in the ADI_CALLCTRL_PARMS eventmask passed to adiStartProtocol (see the source code of inoutcta.c for an example).

· ADIEVN_CALL2_DISCONNECTED: The transfer failed (the line was busy, or the number did not exist, or no dialtone was detected). You are connected back to the original caller in the ADI_CC_STATE_CONNECTED state. The event value field contains the reason.

When the transfer is completed, call adiReleaseCall to go back to the idle state.

adiUnBlockCalls

Requests the TCP to stop blocking calls.

Associated Event:

· ADIEVN_CALLS_UNBLOCKED: The request to unblock the line has been granted.

5.1.2 Unsolicited Events

The following table lists call-control-related unsolicited events:

Event

Description

ADIEVN_BILLING_PULSE

(digital trunks only)

A billing pulse has been received by an outbound application. These are out-of-band pulses, that signify that a unit of cost has been billed to the current call.

This is a low-level event which is enabled only if the ADI_CC_REPTBILLING bit is set in the ADI_CALLCTRL_PARMS eventmask passed to adiStartProtocol.

ADIEVN_IN_SERVICE

The line is back in service.

ADIEVN_INCOMING_CALL

The TCP has handled the setup of an incoming call, and is now waiting for the application to decide if the call must be answered, accepted, or rejected. The application may call adiGetCallStatus to retrieve information on the incoming call. The application may then answer, accept or reject the call as needed within a time period that is protocol specific (usually several seconds).

Note: No time period is specified for analog trunks.

ADIEVN_INCOMING_DIGIT

With digital CAS protocols, you can configure the TCP so that when it receives digits during an incoming call:

· It sends digits to the application one by one as they arrive.

· It sends received digits all at once when they have all arrived.

If the TCP is configured this way, this event indicates that a digit has arrived. The event value field is set to the value of the digit (a char).

ADIEVN_INCOMING_DIGIT is enabled only if the ADI_CC_REPTDIGITS and ADI_CC_REPTSEIZURE bits are set in the ADI_CALLCTRL_PARMS eventmask passed to adiStartProtocol.

ADIEVN_OUT_OF_SERVICE

The called party is blocking the line, or the line and its associated hardware are not configured properly. The TCP will not accept commands until the line comes back into service again. The TCP returns to the Idle state, and generates an ADIEVN_IN_SERVICE event.

ADIEVN_PROTOCOL_ERROR

On digital trunks this indicates that the call failed because the digit string sent from the host with adiPlaceCall had incorrect syntax (for outbound calls on digital trunks only), a timer expired during call set up, or the protocol received an illegal tone for the country for which it was programmed.

On analog trunks this event is usually caused by performing invalid sequences of API function calls. This event will be followed by an ADIEVN_CALL_DISCONNECTED event only if the call state is not idle. This occurs in the following circumstances:

· outbound calls: after the PLACING_CALL event has been received.

· inbound calls: after the INCOMING_CALL event has been received.

ADIEVN_SEIZURE_DETECTED

The line has been seized by an external entity for an incoming call. It is the beginning of the call setup process for an incoming call.

This is a low-level event which is enabled only if the ADI_CC_REPTSEIZURE bit is set in the ADI_CALLCTRL_PARMS eventmask passed to adiStartProtocol (see the source code of inoutcta.c for an example of this).

Note: If the ADI_CC_REPTSEIZURE bit is not set, the ADIEVN_INCOMING_DIGIT event is also disabled.

For MFC-R2, pulsed E and M, and MFS protocols, the call setup procedure may take several seconds. You may wish to enable your application to receive ADIEVN_SEIZURE_DETECTED to prepare to receive an incoming call.

ADIEVN_STATUSINFO_UPDATE

(digital trunks only)

A call status information event has been received by CT Access. This includes billing information for outgoing calls and ANI digits available in the R15 inbound TCP (r150).

The applications receives this low level event only if the ADI_CC_REPTSTATUS_UPDATE bit is set in ADI_CALLCTRL_PARMS eventmask passed to adiStartProtocol. Upon receiving this event, the application can call adiGetCallStatus to analyze the relevant fields in the ADI_CALL_STATUS structure.



(Page 1 of 1 in this chapter)


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