gc_AcceptCall( )
Termination Events | Cautions | Errors | Example | See Also
Name: int gc_AcceptCall(crn, rings, mode) Inputs: Returns: Includes: Category: Mode: Platform and Technology: †See the Global Call Technology User's Guides for additional information.
Description
The gc_AcceptCall( ) function indicates to the originator that the call will be answered, but additional work needs to be done. The function provides a response to a destination party request (GCEV_OFFERED event or termination of the gc_WaitCall( ) function) that acknowledges that the call has been received but is not yet answered (for example, the phone is ringing). Upon successful completion of the gc_AcceptCall( ) function, the call state changes from the Offered state to the Accepted state.
Normally, a gc_AcceptCall( ) function is not required in most voice termination applications. This function may be used when the application needs more time to process an inbound call request, such as in a drop and insert application in which the outbound dialing process may be time consuming.
crn call reference number rings specifies how long (the number of rings) the protocol handler will wait before notifying the calling entity. Valid values are: For protocols not using rings, the rings parameter is ignored.
- 0 to 14
- 15 or greater
- the call will ring forever; this allows the application to accept calls without answering them. However, the call can still be answered after 15 or more rings using gc_AnswerCall( ).
mode set to EV_ASYNC for asynchronous execution or to EV_SYNC for synchronous execution Termination Events
- GCEV_ACCEPT
- indicates successful completion of the gc_AcceptCall( ) function, that is, the inbound call was accepted
- GCEV_TASKFAIL
- indicates that the function failed. For more information, see the "Error Handling" section in the Global Call API Programming Guide.
Cautions
If this function is invoked for an unsupported technology, the function fails. The error value EGC_UNSUPPORTED will be the Global Call value returned when the gc_ErrorInfo( ) function is used to retrieve the error code.
Errors
If this function returns <0 to indicate failure, use the gc_ErrorInfo( ) function for error information. If the GCEV_TASKFAIL event is received, use the gc_ResultInfo( ) function to retrieve information about the event. See the "Error Handling" section in the Global Call API Programming Guide. All Global Call error codes are defined in the gcerr.h file. If the error returned is technology specific, see the technology-specific error header file(s) for the error definition (for example, ccerr.h or isdnerr.h file for the ISDN call control library).
Example
#include <stdio.h> #include <srllib.h> #include <gclib.h> #include <gcerr.h> /* *Assume the following has been done: * 1. Opened line devices for each time slot on DTIB1. * 2. Wait for a call using gc_WaitCall() * 3. An event has arrived and has been converted to a metaevent * using gc_GetMetaEvent() or gc_GetMetaEventEx() (Windows) * 4. The event is determined to be a GCEV_OFFERED event */ int accept_call(void) { CRN crn; /* Call Reference Number */ GC_INFO gc_error_info; /* GlobalCall error information data */ /* * Accept the incoming call. */ crn = metaevent.crn; if (gc_AcceptCall(crn, 0, EV_ASYNC) != GC_SUCCESS) { /* process error return as shown */ gc_ErrorInfo( &gc_error_info ); printf ("Error gc_AcceptCall() on device handle: 0x%lx, GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n", metaevent.evtdev, gc_error_info.gcValue, gc_error_info.gcMsg, gc_error_info.ccLibId, gc_error_info.ccLibName, gc_error_info.ccValue, gc_error_info.ccMsg); return (gc_error_info.gcValue); } /* * gc_AcceptCall() terminates with GCEV_ACCEPT event. * When GCEV_ACCEPT is received, the state changes to * Accepted and gc_AnswerCall() can be issued to complete * the connection. */ return (0); }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation