Dialogic 05-0867-005 Table Top Game User Manual


 
sets up conditions for processing an incoming call cc_WaitCall( )
291
To receive incoming waiting calls, applications using the NTT protocol
must use the cc_SetInfoElem( ) function to override the default Channel
ID IE content. This ensures that the application complies with the NTT
protocol specification requiring the first reply to the SETUP message to
specify the B channel on which the call will proceed.
The application should always release the call reference number after the
termination of a connection by calling cc_ReleaseCall( ). Failure to do so
may cause memory allocation errors.
In asynchronous mode, the CRN will not be available until an incoming call
has arrived. In synchronous mode, the CRN will not be available until the
cc_WaitCall( ) function completes successfully.
The structures crnptr and waitcall_blkp should be globally allocated.
!
! !
!
Example
#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;
if ( cc_Open( &devhdl, devname,0)<0)
{
printf(Error opening device: errno = %d\n, errno);
exit(1);
}
printf(Waiting for call\n);
if ( cc_WaitCall(devhdl, &crn, NULL, -1, EV_SYNC) <0)
procdevfail(devhdl);
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);