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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

etrieve the network call reference value — gc_GetNetCRV( )<br />

returned is technology specific, see the technology-specific error header file(s) for the error<br />

definition (for example, ccerr.h or isdnerr.h file for the ISDN call control library).<br />

Example<br />

/*<br />

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

* 1. device has been opened (e.g. :N_dtiB1T1:P_isdn, :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 get_net_crv()<br />

{<br />

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

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

int netcrv; /* Network <strong>Call</strong> <strong>Reference</strong> Value */<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. Get the corresponding line device<br />

* 3. Proceed to retrieve the <strong>Call</strong> <strong>Reference</strong> Value as shown below<br />

*/<br />

crn = metaevent.crn;<br />

if(gc_CRN2LineDev(crn, &ldev) != GC_SUCCESS) {<br />

/* process error return as shown */<br />

gc_ErrorInfo( &gc_error_info );<br />

printf ("Error: gc_CRN2LineDev() on crn: 0x%lx, GC ErrorValue: 0x%hx - %s,<br />

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

crn, 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 />

if(gc_GetNetCRV(crn, &netcrv) != GC_SUCCESS) {<br />

/* process error return as shown */<br />

gc_ErrorInfo( &gc_error_info );<br />

printf ("Error: gc_GetNetCRV() on linedev: 0x%lx, GC ErrorValue: 0x%hx - %s,<br />

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

ldev, 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 />

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

Dialogic Corporation

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

Saved successfully!

Ooh no, something went wrong!