cc_ReleaseCallEx( ) release all Dialogic ISDN resources
188
exit(1);
}
else
printf("Waiting for call...\n");
.
.
.
/* wait indefinitely for events */
sr_waitevt(-1);
/* continue with application */
.
.
.
.
} /* end main */
/***********************************************/
/* defaultHandler - default event handler */
/***********************************************/
int defaultHandler()
{
int devindx;
int dev = sr_getevtdev();
int len = sr_getevtlen();
int typ = sr_getevttype();
void *datap = sr_getevtdatap();
/* process all incoming events in one switch statement */
switch(typ)
{
.
.
.
case CCEV_DROPCALL:
printf("Asynchronous cc_DropCall() completed\n");
/* release the call asynchronously so as not to block within an async handler */
if (cc_ReleaseCallEx(crn, EV_ASYNC))==-1){
printf("Error in cc_ReleaseCall(): error code = %x\n", cc_CauseValue(ldev));
}
else printf("Asynchronous cc_ReleaseCall sent...waiting for completion event
CCEV_RELEASECALL...\n");
/* the next case is the completion event for the asynchronous cc_ReleaseCall */
case CCEV_RELEASECALL:
printf("Asynchronous cc_ReleaseCall completed\n");
break;
} /* end switch */
} /* end defaultHandler() */
!
! !
!
Errors
If the function returns < 0 to indicate failure, use the cc_CauseValue( ) function
to retrieve the reason code for the failure. The cc_ResultMsg( ) function can be
used to interpret the reason code. Error codes are defined in the files ccerr.h,
isdnerr.h, and isdncmd.h.