Dialogic Dialogic Global Call IP IP Phone User Manual


 
283
Dialogic Corporation
printf("gc_Start() failed: Unable to retrieve error value\n");
}
else
{
gc_ResultMsg(LIBID_GC, (long) gc_error, &resultmsg);
printf("gc_ReqService() failed: gc_error=0x%X: %s\n", gc_error, resultmsg);
gc_ResultMsg(cclibid, cc_error, &resultmsg);
gc_CCLibIDToName(cclibid, &lib_name);
printf("%s library had error 0x%lx - %s\n", lib_name, cc_error, resultmsg);
}
gc_util_delete_parm_blk(pParmBlock);
return GC_ERROR;
}
printf ("Unregister request to the GK was sent ...\n");
gc_util_delete_parm_blk(pParmBlock);
return GC_SUCCESS;
}
4.22.4.2 Deregistration Example
The following code example shows how to populate a GC_PARM_BLK structure that can be used
to deregister an endpoint with a gatekeeper (H.323). The GC_PARM_BLK structure contains the
following deregistration information:
the type of operation (in this case, deregister) and sub-operation (do not retain the registration
information locally)
two mandatory parameters required by the generic gc_ReqService( ) function
the protocol type (in this case, H.323)
void unregister()
{
GC_PARM_BLKP pParmBlock = NULL;
unsigned long serviceID = 1;
int rc,frc;
int gc_error; // GC error code
int cclibid; // Call Control library ID for gc_ErrorValue
long cc_error; // Call Controll library error code
char *resultmsg; // String associated with cause code
char *lib_name; // Library name for cclibid
gc_util_insert_parm_val(&pParmBlock,
IPSET_REG_INFO,
IPPARM_OPERATION_DEREGISTER,
sizeof(unsigned char),
IP_REG_DELETE_ALL);
frc = gc_util_insert_parm_val(&pParmBlock,
GCSET_SERVREQ,
PARM_REQTYPE,
sizeof(unsigned char),
IP_REQTYPE_REGISTRATION);
if (frc != GC_SUCCESS)
{
printf("failed in PARM_REQTYPE\n");
termapp();
}