BRI Service Developer's Reference Manual (6569-11): Alphabetical Function Reference
(Page 2 of 15 in this chapter) Version
briAcceptCall
Description
- Accepts an incoming call without answering or rejecting it.
Prototype
- DWORD briAcceptCall ( CTAHD ctahd,
unsigned method,
void *reserved)
- ctahd CTA context handle returned by ctaCreateContext.
- method Specifies the trunk protocol action for accepting the call. Must be set to zero (0).
- reserved Reserved for future use.
Return Values
Events
Details
- briAcceptCall causes the ISDN protocol to accept the incoming call, entering the accepting call state.
- If the remote party disconnects while the application accepts the call, then the BRI service generates a BRIEVN_CALL_DISCONNECTED event. In this case, no BRIEVN_ACCEPTING_CALL event is delivered.
- Refer to Chapter 4 for a detailed explanation of call control.
See Also
- briAnswerCall, briPlaceCall, briRejectCall, briReleaseCall,
Example
/*
* We can decide to defer our decision to answer or not. This might be
* because, based on the associated information, we want to do something
* that might require some time, i.e., a database search or placing an
* outbound call to be then connected with this call.
* Or we might want to play a voice file before answering.
* To do this, we call briAcceptCall.
*/
briAcceptCall (cx->ctahd, 0, NULL);
WaitForAnyEvent( cx->ctahd, &nextevent );
switch (nextevent.id)
{
case BRIEVN_STATUS_UPDATE:
/*
* Some asynchrounous information regarding the call has arrived
* from the line. This could be user to user information.
* You can tell the kind of information looking at the event's
* value field.
*/
briGetCallStatus( cx->ctahd, &status, sizeof(status) );
if (nextevent.value == CALL_STATUS_UUI)
{
printf ("\tMyReceiveCall:UUI arrived:\n""\t %s\n", status.callingaddr);
}
else
printf ("\tMyReceiveCall, unexpected status info %d\n",
nextevent.value);
break;
case BRIEVN_ACCEPTING_CALL:
/*
* We wait silently for a while and then answer.
*
* Note that if the application acts as a gateway (for instance,
* between different protocols), this is the time to place the
* outbound part of this call. This is demonstrated here by the user
* pressing the <ENTER> key, which represents the outbound call being
* accepted. The inbound call may then be answered immediately when the
* BRIEVN_CALL_CONNECTED event is received from the outbound call.
*/
printf ("\tMyReceiveCall: Accepting... Press <enter> to answer\n");
adiStartTimer(cx->ctahd, 10000, 1); /* wait ten seconds */
while (!timer_done)
{
WaitForAnyEvent( cx->ctahd, &nextevent );
switch (nextevent.id)
{
case ADIEVN_TIMER_DONE:
printf ("\tMyReceiveCall: timer done: exiting loop\n");
timer_done = TRUE;
break;
case BRIEVN_CALL_DISCONNECTED:
adiStopTimer (cx->ctahd);
do
{
WaitForAnyEvent( cx->ctahd, &nextevent );
} while (nextevent.id != ADIEVN_TIMER_DONE);
printf( "\tMyReceiveCall: call disconnected\n");
ret = DISCONNECT;
goto hangup_in;
case KEYBOARD_EVENT:
adiStopTimer (cx->ctahd);
do
{
WaitForAnyEvent( cx->ctahd, &nextevent );
} while (nextevent.id != ADIEVN_TIMER_DONE);
timer_done = TRUE;
break;
default:
printf("\tMyReceiveCall, bad event while accepting: 0x%x\n",
nextevent.id);
break;
} /* switch */
} /* while */
break;
default:
printf("\tMyReceiveCall, bad event from briAcceptCall: 0x%x\n",
nextevent.id);
ret = FAILURE;
goto hangup_in;
} /* switch */
(Page 2 of 15 in this chapter) Version
tech_support@nmss.com
Copyright © 1999, Natural MicroSystems, Inc. All rights
reserved.