Dialogic 05-0867-005 Table Top Game User Manual


 
cc_Restart( ) resets the channel to Null state
196
.
.
cc_Close(devhdl);
}
/******************************************************************
/* NAME: void WaitCallThread(devhdlptr)
/* DESCRIPTION: Waits for incoming call.
/* INPUT: devhdlptr - pointer to devhdl
/* RETURNS: none.
******************************************************************/
void WaitCallThread(void *devhdlptr)
{
short devhdl = *devhdlptr; /* device handle */
CRN crn; /* call reference number */
.
.
.
while(1)
{
.
.
.
/* wait for an incoming call */
if ( cc_WaitCall(devhdl,&crn,NULL,-1,EV_SYNC)<0)
procdevfail(devhdl);
if ( cc_AnswerCall(crn,0,EV_SYNC)<0)
callfail(crn);
.
.
.
.
}
.
.
.
}
/*
/* function to make an outbound call
*/
int makecall(short devhdl)
{
CRN crn; /* call reference number */
char *dialnum = 12019933000; /* outgoing phone number */
.
.
.
/*
*This cc_Restart() allows the B channel line device to
*escape from cc_WaitCall(), or other multitasking
*functions.
*/
if ( cc_Restart(devhdl, EV_SYNC) <0)
procdevfail(devhdl);
/*
* Now its safe to make a call. To avoid contention,
* a mechanism to prevent other multitasking functions
* from being invoked again, such as cc_WaitCall(),