Dialogic 05-0867-005 Table Top Game User Manual


 
cc_GetNetCRV( ) retrieves the network call reference value
132
#include "srllib.h"
#include "dtilib.h"
#include "cclib.h"
void main()
{
LINEDEV devhdl = 0;
CRN crn = 0;
char *devname = "dtiB1T1";
if ( cc_Open( &devhdl, devname,0)<0)
{
printf("Error opening device: errno = %d\n", errno);
exit(1);
}
if ( sr_enbhdlr(devhdl, CCEV_OFFERED, (HDLR)OfferedHdlr) ==<0)
{
printf ( sr_enbhdlr for OFFERED failed: %s\n, ATDV_ERRMSGP(devhdl));
return (1);
}
}
/*
* OfferedHdlr - Accept the incoming call
*/
OfferedHdlr()
{
LINEDEV dev;
int len;
void *datap;
CRN crn;
int netcrv;
dev = sr_getevtdev();
len = sr_getevtlen();
datap = sr_getevtdatap();
/* Obtain the call reference number */
if (cc_GetCRN(&crn, datap) != 0
{
printf ( cc_GetCRN: error\n );
return < 0;
}
/* Use the CRN obtained above to get the Network CRV (Call Reference Value) */
if (cc_GetNetCRV(crn, &netcrv) == 0)
{
printf ( cc_GetNetCRV(%X, %d) success\n , crn, netcrv);
return 0;
}
else
{
printf ( cc_GetNetCRV(%X) failure !!!\n, crn);
return -1;
}
}