08.01.2013 Views

Dialogic® Global Call API Library Reference

Dialogic® Global Call API Library Reference

Dialogic® Global Call API Library Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

gc_RetrieveAck( ) — accept a retrieve request from remote equipment<br />

Example<br />

/*<br />

* Assume the following has been done:<br />

* 1. device has been opened (e.g. :N_dtiB1T1:P_isdn,<br />

* :N_dtiB1T2:P_isdn, etc...)<br />

* 2. gc_Wait<strong>Call</strong>() has been issued to wait for a call.<br />

* 3. gc_GetMetaEvent() or gc_GetMetaEventEx() (Windows) has been<br />

* called to convert the event into metaevent.<br />

* 4. a GCEV_OFFERED event has been detected.<br />

*/<br />

#include <br />

#include <br />

#include <br />

#include <br />

#include <br />

METAEVENT metaevent;<br />

int retrieve_call()<br />

{<br />

LINEDEV ldev; /* Line device */<br />

CRN crn; /* call reference number */<br />

GC_INFO gc_error_info; /* <strong>Global</strong><strong>Call</strong> error information data */<br />

}<br />

/*<br />

* Do the following:<br />

* 1. Get the CRN from the metaevent<br />

* 2. Proceed to retrieve the call on hold<br />

*/<br />

crn = metaevent.crn;<br />

if(gc_Retrieve<strong>Call</strong>(crn, EV_ASYNC) != GC_SUCCESS) {<br />

/* Process error */<br />

gc_ErrorInfo( &gc_error_info );<br />

printf ("Error: gc_Retrieve<strong>Call</strong>() on device handle: 0x%lx, GC ErrorValue: 0x%hx - %s,<br />

CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n",<br />

metaevent.evtdev, gc_error_info.gcValue, gc_error_info.gcMsg,<br />

gc_error_info.ccLibId, gc_error_info.ccLibName,<br />

gc_error_info.ccValue, gc_error_info.ccMsg);<br />

return (gc_error_info.gcValue);<br />

}<br />

return 0;<br />

/* Retrieve events from SRL */<br />

int evt_hdlr()<br />

{<br />

LINEDEV ldev; /* Line device */<br />

CRN crn; /* <strong>Call</strong> <strong>Reference</strong> Number */<br />

GC_INFO gc_error_info; /* <strong>Global</strong><strong>Call</strong> error information data */<br />

int retcode; /* Return Code */<br />

retcode = gc_GetMetaEvent(&metaevent);<br />

if (retcode != GC_SUCCESS) {<br />

/* get and process the error */<br />

}<br />

else {<br />

/* Continue with normal processing */<br />

}<br />

crn = metaevent.crn;<br />

switch(metaevent.evttype) {<br />

282 Dialogic ® <strong>Global</strong> <strong>Call</strong> <strong>API</strong> <strong>Library</strong> <strong>Reference</strong> — January 2008<br />

Dialogic Corporation

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!