
Description | Cautions | Example | Errors | See Also
Name: |
int cc_StopTrace(boarddev) | |
Inputs: |
LINEDEV boarddev |
|
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
System control | |
Mode: |
asynchronous | |
Technology: |
BRI/2; BRI/SC; PRI (all protocols) | |
The cc_StopTrace( ) function stops the trace that was started using the cc_StartTrace( ) function, discards the trace information, and closes the file.
Parameter |
Description |
boarddev: |
The line device handle of the D channel board. |
None
#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 brddevhdl; /* device handle for D channel */
LINEDEV devhdl = 0;
CRN crn = 0;
char *devname = "dtiB1";
.
.
.
if ( cc_Open(brddevhdl,devname, 0 ) < 0 )
exit(1);
if ( cc_Open( &devhdl, devname, 0 ) < 0 )
{
printf("Error opening device: errno = %d\n", errno);
exit(1);
}
/*
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);
}
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.
Error codes from the cc_StopTrace( ) function include the following:
Error Code |
Description |
ERR_ISDN_LIB | E_ISTNACT |
Trace information is not/is already activated |
ERR_ISDN_LIB | E_ISBADIF |
Bad interface number |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation