cc_StopTrace( ) stops the trace276
}
/* using cc_StartTrace() to begin
the trace function and save it on file “istrace.log”.
Note that the brddevhdl is a board level device.
*/
if ( cc_StartTrace(brddevhdl,”istrace.log”)<0)
procdevfail(brddevhdl);
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);
/* using cc_StopTrace() to stop
the trace function and close the file.
Note that the brddevhdl is a board level device.
*/
if(cc_StopTrace(brddevhdl) <0)
procdevfail(brddevhdl);
/* Close the device */
if ( cc_Close( devhdl)<0)
printf(“Error closing device, errno = %d\n”, errno);
if ( cc_Close(brddevhdl)<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);
cc_ResultMsg(handle,reason,&msg);
printf(“reason = %x - %s\n”,reason,msg);
}