Informizely customer feedback surveys
By using the Aculab site, you agree with our use of cookies.

How do I enable fax tracing to a file?

To enable fax tracing to a file in your fax application, do the following:-

  1. Add the following headers to your application.

    #include "bfile.h"
    #include "bfopen.h"

  2. 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;


    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? );

    logFile = 0;

  3. Add the following code before fax negotiation.

    rc = smfax_trace_on(&faxTraceParms);

  4. Add the following code after closing the fax session.
    rc = bfile_dtor(logFile);