How do I enable fax tracing to a file?
To enable fax tracing to a file in your fax application, do the following:-
-
Add the following headers to your application.
#include "bfile.h"
#include "bfopen.h" -
Add the following code after opening the fax session.
// NOTE : You must set logFileName
char *logFileName;
SMFAX_TRACE_PARMS faxTraceParms;
BFILE * logFile = 0;
long int logLevel = TRACE_ALL;
int rc = 0;ACU_INIT_SM_STRUCT(&faxTraceParm);
if(logLevel)
{
rc = bfile(&logF);
if(0 == rc)
{
// assuming faxSession is the pointer to your fax session.
faxTraceParms.fax_session = &faxSession;
faxTraceParms.log_file = logFile;
faxTraceParms.trace_level = logLevel;rc = bfopen(logFile, logFileName, "wtc");|
// if there is an error opening the log file, destroy it.
if(rc != 0)
{printf( ?Could not open trace file\n? );
if(logFile)
{bfile_dtor(logFile);
logFile = 0;
}
}
}
} -
Add the following code before fax negotiation.
if(logFile)
rc = smfax_trace_on(&faxTraceParms); -
Add the following code after closing the fax session.
if(logFile)
rc = bfile_dtor(logFile);