accept a request to retrieve a call from hold cc_RetrieveAck( )
205
.
.
.
if ( cc_Open( &ldev, devname,0)<0)
{
printf("Error opening device: errno = %d\n", errno);
exit(1);
}
if ( sr_enbhdlr( ldev,CCEV_HOLDCALL,HoldCallHdlr)<0)
{
printf( "dtiEnable for HoldCallHdlr failed: %s\n",
ATDV_ERRMSGP( SRL_DEVICE ) );
return( 1 );
}
if ( sr_enbhdlr( ldev,CCEV_RETRIEVECALL,RetrieveCallHdlr)<0)
{
printf( "dtiEnable for RetrieveCallHdlr failed: %s\n",
ATDV_ERRMSGP( SRL_DEVICE ) );
return( 1 );
}
.
.
.
.
while (1)
{
/* wait for network event */
sr_waitevt(-1);
}
cc_Close(ldev);
}
/***************************************************/
/* HoldCallHdlr - accept the hold call request */
/***************************************************/
int HoldCallHdlr( )
{
CRN crn_buf;
LINEDEV ldev = sr_getevtdev();
int len = sr_getevtlen();
void *ev_datap = sr_getevtdatap();
cc_GetCRN(&crn_buf, ev_datap);
if ( cc_HoldAck( crn_buf)<0)
procdevfail(ldev);
return( 0 );
}
/***********************************************************/
/* RetrieveCallHdlr - accept the retrieve call request */
/***********************************************************/
int RetrieveCallHdlr( )
{
CRN crn_buf;
LINEDEV ldev = sr_getevtdev();
int len = sr_getevtlen();
void *ev_datap = sr_getevtdatap();
cc_GetCRN(&crn_buf, ev_datap);
if ( cc_RetrieveAck( crn_buf ) <0)
procdevfail(ldev);