Dialogic Dialogic Global Call IP IP Phone User Manual


 
152 Dialogic
®
Global Call IP Technology Guide — November 2007
Dialogic Corporation
IP-Specific Operations
#include <stdio.h>
#include <srllib.h>
#include <gclib.h>
#include <gcerr.h>
#include <gcip.h>
/*
* Assume the 'crn' parameter holds the CRN associated
* with the detected GCEV_OFFERED event.
*/
int request_call_info(CRN crn)
{
int retval = GC_SUCCESS;
GC_PARM_BLKP parmblkp = NULL; /* input parameter block pointer */
GC_PARM_BLKP retblkp = NULL; /* pointer for output parameter block (unused) */
GC_INFO gc_error_info; /* GlobalCall error information data */
/* allocate GC_PARM_BLK for Call-ID message parameter */
gc_util_insert_parm_val(&parmblkp, IPSET_CALLINFO, IPPARM_CALLID, sizeof(int), 1);
if (parmblkp == NULL)
{
/* memory allocation error */
return(-1);
}
/* retrieve the Call-ID from the network */
if (gc_Extension(GCTGT_GCLIB_CRN, crn, IPEXTID_GETINFO, parmblkp, &retblkp,
EV_ASYNC) != GC_SUCCESS)
{
/* process error return as shown */
gc_ErrorInfo( &gc_error_info );
printf ("Error: gc_Extension() on crn: 0x%lx, GC ErrorValue: 0x%hx - %s,
CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n",
crn, gc_error_info.gcValue, gc_error_info.gcMsg, gc_error_info.ccLibId,
gc_error_info.ccLibName, gc_error_info.ccValue, gc_error_info.ccMsg);
}
/* free the parameter block */
gc_util_delete_parm_blk(parmblkp);
return (retval);
}
Parsing Call ID Information (SIP Protocol)
The following code example illustrates how to parse the Call ID information retrieved via a
gc_Extension( ) call when the SIP protocol is being used.
/*
* Assume the following has been done:
* 1. device has been opened (e.g. :N_iptB1T1:P_SIP, :N_iptB1T2:P_SIP, etc...)
* 2. gc_GetMetaEvent() or gc_GetMetaEventEx() (Windows) has been called
* to convert the event into metaevent.
* 3. a GCEV_EXTENSIONCMPLT has been detected.
*/
#include <stdio.h>
#include <srllib.h>
#include <gclib.h>
#include <gcerr.h>
#include <gcip.h>
/* Assume the 'crn' parameter holds the CRN associated with the detected GCEV_EXTENSIONCMPLT
* event, and the 'pEvt' parameter holds a pointer to the detected metaevent.
*/