(Page 2 of 69 in this chapter) Version
adiAcceptCall
Description
- Accepts an incoming call without answering or rejecting it.
Note: This function and all other ADI call control functions have been superseded by the NCC service. For more information, see the Natural Call Control Service Developer's Reference Manual.
Prototype
- DWORD adiAcceptCall
( CTAHD ctahd,
unsigned method,
void *reserved)
- ctahd CTA context handle returned by ctaCreateContext.
- method Specifies the trunk protocol action for accepting the call.
- reserved Reserved for future use. Must be 0.
Return Values
Events
Details
- adiAcceptCall causes the trunk protocol to accept the incoming call and enters the Accepting Call state. The trunk protocol accepts the call using one of the following methods:
- The generated tone is played until the application invokes adiAnswerCall or adiRejectCall, or the remote party disconnects.
- If method is ADI_ACCEPT_USER_AUDIO, the application can generate any programmable tone and perform voice playback functions. For example, the application could generate an SIT (Special Information Tone) message. The application must wait for the ADIEVN_ACCEPTING_CALL event before generating an SIT.
- If the remote party disconnects while the application accepts the call, then the ADI service generates an ADIEVN_CALL_DISCONNECTED event. In this case, no ADIEVN_ACCEPTING_CALL event is delivered.
- Some protocols allow you to use adiSetExtendedArgs to set additional arguments to adiAcceptCall. For more information about controlling calls under specific TCPs, refer to the AG CAS for ADI Service Installation and Developer's Manual.
- adiAcceptCall
is not available when using the NOCC protocol.
See Also
- adiAnswerCall, adiPlaceCall, adiRejectCall, adiReleaseCall, adiSetExtendedArgs
Example
/* Wait for a call and return when the call is successfully answered */
void MyWaitForCall( CTAHD ctahd )
{
for (;;)
{
CTA_EVENT event;
ADI_CALL_STATUS status;
MyWaitForEvent( ctahd, &event );
switch( event.id )
{
case ADIEVN_INCOMING_CALL:
/* Get called number (DNIS) and calling number (ANI) */
adiGetCallStatus( ctahd, &status, sizeof status );
if (! MyLookupNumber(status.calledaddr))
/* If called number is not in service, play reorder until
* the caller hangs up. */
adiRejectCall (ctahd, ADI_REJ_PLAY_REORDER);
/* Wait for REJECTING_CALL and/or CALL_DISCONNECTED */
else
/* If called number is acceptable, play ringing while
* doing further lookups. */
adiAcceptCall (ctahd, ADI_ACCEPT_PLAY_RING, NULL);
/* Wait for ACCEPTING_CALL */
break;
case ADIEVN_ACCEPTING_CALL:
mylookupcallingnumber ( status.callingaddr);
/* Assume this might take a while and sends a
* user-defined event when done. */
break;
case MY_LOOKUP_COMPLETE:
adiAnswerCall(ctahd, 0); /* Answer the call */
/* Wait for CALL_CONNECTED */
break;
case ADIEVN_CALL_CONNECTED:
return; /* Success! */
case ADIEVN_CALL_DISCONNECTED: /* The caller abandoned the call. */
adiReleaseCall(ctahd);
/* wait for CALL_RELEASED */
break;
case ADIEVN_CALL_RELEASED: /* Response to adiReleaseCall */
/* Now in idle state; wait for another INCOMING_CALL */
break;
case ADIEVN_REJECTING_CALL: /* Response to adiRejectCall */
/* Wait for CALL_DISCONNECTED */
break;
/* Swallow these low-level events. */
case ADIEVN_SEIZURE_DETECTED:
case ADIEVN_PROTOCOL_ERROR : /* e.g. abandoned after seizure */
case ADIEVN_OUT_OF_SERVICE: /* e.g, permanent signal */
case ADIEVN_IN_SERVICE: /* back in service after OOS */
break;
default:
MyReportUnexpectedEvent( &event );
break;
}
}
}
(Page 2 of 69 in this chapter) Version
Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights
reserved.