User`s guide

Dialogic
®
System Release 6.0 PCI for Windows
®
Release Update, Rev 62 — January 30, 2008 95
Dialogic Corporation
Dialogic
®
D/600JCT-2E1 Media Boards
1.28.3 Example Code
#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 answer_call(int num_rings, int dbl_answ_flag)
{
CRN crn; /* call reference number */
GC_INFO gc_error_info; /* GlobalCall error information data */
int rings = 0;
/*
* Do the following:
* 1. Get the CRN from the metaevent
* 2. Proceed to answer the call as shown below
*/
crn = metaevent.crn;
/*
* Answer the incoming call. Check the dbl_answ_flag to determine
* if double answer should be triggered or not
*/
if (dbl_answ_flag)
rings = num_rings | GC_DBL_ANSWER;
else
rings = num_rings;
if (gc_AnswerCall(crn, rings, EV_ASYNC) != GC_SUCCESS) {
/* process error return as shown */
gc_ErrorInfo( &gc_error_info );
printf ("Error: gc_AnswerCall() 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_AnswerCall() terminates with GCEV_ANSWERED event
*/
return (0);
}
1.28.4 Documentation
The online bookshelf provided with Dialogic
®
System Release 6.0 PCI for Windows
®
contains information about all system release features including features for application
development, configuration, administration, and diagnostics.