FaxMan SDK Version 4.7
Dealing with Fax Logs

The FaxMan server keeps all of the information contained in the SEND_FAX structure for each fax sent or received through the server. The logs are stored in a file called faxman4.db. For both servers these files are stored in the same directory as the server executable.


As described in the section covering the FaxMan server, there are five logical log groupings within this file:


Pending Log — the faxes that have been scheduled but not sent. This also includes faxes that have been rescheduled due to some type of problem with transmission.


Sending Log — the faxes that are currently sending. Note that there may be more than one of these at any given time, depending on the number of faxmodems installed in your system.


Completed Log — the faxes that were successfully sent


Failed Log — the faxes that did not go through successfully


Received Log — All received faxes are placed in this log, whether they were successfully received or not.


Any time a fax is added or removed from any of these logs, your application will get a notification message (assuming, of course, that it has subscribed to this event message using FaxSubscribe). So, for example, when an item goes from the Pending Log into the Sending Log, your app will get two notifications: one to tell it that the item was removed from the Pending Log and one to tell it that an item was added to the Sending Log. For more information on these notification messages, see the reference section on the FAXLOGADD/FAXLOGREMOVE notification messages.


OK, so you've got your app all primed and ready to receive these wonderful log notification messages, and your application is now loaded—how does your application know what the current state of the logs is, before any notification messages are sent? The answer to this is, of course, to use the log iteration functions, FaxLogInit and FaxLogNext. These will allow your application to step through each log one item at a time and retrieve its' log entries. The following code fragment illustrates how to do this for the sending log; the code for the other logs is identical except for the FaxLogInit function which starts off the whole process:



SEND_FAX tmpsf;



 while (FaxLogNext(pInfo, &tmpsf) == LOGERR_CONTINUEIT) {

  //add the fax info to our log here




Note that the FaxLogNext function assumes that the FaxLogInit function has been called previously to setup the iteration. Never call FaxLogNext unless you've first called FaxLogInit to properly initialize the iteration.


The remaining log functions are straightforward: FaxLogCount returns the number of entries in a given log, FaxLogFind will return the information associated with a given fax ID from the FaxMan logs and FaxLogDelete will delete a log entry from the log.



© 2013 Data Techniques, Inc. All Rights Reserved.

Send comments on this topic.