Dialogic 05-0867-005 Table Top Game User Manual


 
cc_SetMinDigits( ) sets the minimum number of digits to be collected
242
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <errno.h>
#include srllib.h
#include dtilib.h
#include cclib.h
void main()
{
LINEDEV devhdl = 0;
CRN crn = 0;
char *devname = dtiB1T1;
char dnis_buf[CC_ADDRSIZE];
if ( cc_Open( &devhdl, devname,0)<0)
{
printf(Error opening device: errno = %d\n, errno);
exit(1);
}
/*
* using cc_SetMinDigits(linedev, mindigits) to set minimum
* digits to be collected before terminating the WaitCall().
* Only needed when overlap receiving is needed.
*/
if ( cc_SetMinDigits(linedev, mindigits) <0)
procdevfail(devhdl);
if ( cc_WaitCall(devhdl, &crn, NULL, -1, EV_SYNC)<0)
procdevfail(devhdl);
printf(Retrieving DNIS\n);
if ( cc_GetDNIS(crn,dnis_buf)<0)
callfail(crn);
else
printf(cc_GetDNIS succeeded: %s\n,dnis_buf);
if ( cc_AnswerCall(crn, 0, EV_SYNC)<0)
callfail(crn);
/* Voice process after this. */
.
.
.
.
.
/* Drop the call */
if ( cc_DropCall(crn, NORMAL_CLEARING, EV_SYNC)<0)
callfail(crn);
if ( cc_ReleaseCall(crn)<0)
callfail(crn);
/* Close the device */
if ( cc_Close( devhdl)<0)
printf(Error closing device, errno = %d\n, errno);
}
int callfail(CRN crn)
{
LINEDEV ld;
cc_CRN2LineDev(crn,&ld);
procdevfail(ld);
}