
Description | Cautions | Example | Errors | See Also
Name: |
int cc_StartTrace(boarddev, FileName) | |
Inputs: |
LINEDEV boarddev |
|
char *FileName |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
System tools | |
Mode: |
synchronous | |
Technology: |
BRI/2; BRI/SC; PRI (all protocols) | |
The cc_StartTrace( ) function instructs the firmware to start the capture of all D channel information into a specified log file. The firmware traces the D channel communications between the Dialogic board and the network, places the results in the shared RAM, and opens a file under the FileName parameter. The results are then placed in the specified file, which is stored on the Dialogic board.
The cc_StartTrace( ) function allows the application to trace ISDN messages on the specified D channel. The saved trace file is interpreted off line by the isdtrace utility program supplied with the release package. (For more on the isdtrace utility program, see Section 8.5.2. ISDTRACE Utility.) The trace continues until cc_StopTrace( ) is issued. Complete information on the trace is not available until the cc_StopTrace( ) function is executed.
Parameter |
Description |
boarddev: |
The board device handle of the ISDN span that contains the D channel. |
FileName: |
The file name for the trace. |
#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);
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_StartTrace( ) 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