Dialogic 05-0867-005 Table Top Game User Manual


 
collects more digits via overlap receiving cc_GetMoreDigits( )
129
{
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 ( cc_WaitCall(devhdl, &crn, NULL, -1, EV_SYNC)<0)
procdevfail(devhdl);
if ( cc_GetDNIS(crn, dnis_buf)<0)
callfail(crn);
/*
* The cc_GetMoreDigits() function can only be called
* after the cc_WaitCall and before cc_CallProgress(),
* cc_AcceptCall() and cc_AnswerCall().
*/
if ( (more_digits = (MIN_DNIS - strlen(dnis_buf))>0)
if ( cc_GetMoreDigits(crn, more_digits, time_out, EV_SYNC) <0)
callfail(crn);
printf("Accepting call\n");
if ( cc_AcceptCall(crn, 0, EV_SYNC)<0)
callfail(crn);
if ( cc_AnswerCall(crn, 0, EV_SYNC)<0)
callfail(crn);
.
.
.
.
.
/* 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);
}
int procdevfail(LINEDEV handle)
{
int reason;
char *msg;
reason = cc_CauseValue(handle);