BFAX_SEND_FAX will determine which method is being used by the callback_st parameter. If callback_st is empty, the fax will be sent on the same call. If, however, callback_st contains a state table name the fax will be queued, and when the fax is actually sent (during a second call) the specified state table will be invoked in order to log the status of the fax-send operation.
InvokeStateTable ("DIRECT", BFAX_SEND_FAX, begin, filename, profile_id, callback_st, curlistfile, calling_number, called_number, device_rc, device_state);
The entry point for this state table is begin
When a single .tif file is processed an initial check is made to see whether the file exists and can be read. If it cannot, an error is reported; otherwise, the .tif file is sent using the Brooktrout API. If a problem is detected while the fax is being sent, an error is reported.
TIFF files have been categorized into Classes to reduce the information burden on TIFF readers and writers that want to support narrow applications. TIFF Class F file format defines a file format that is simultaneously suitable for native use in Group 3 computer facsimile products and for use as a file-interchange medium with the outside world. Greater details concerning TIFF Classes, in particular TIFF Class F file format, are available in a Brooktrout Technology Technical White Paper and can be found at the Brooktrout Web site by going to www.brooktrout.com.
<text-tiff-utility-name> <filename.txt> <filename.tif>The .tif file is then sent using the Brooktrout API. If a problem is detected while the fax is being sent, an error is reported.
Provided that the user can supply a utility to convert files from PCX to TIFF-F format, the fax feature is able to handle PCX files for transmission.
The full path and file name of the utility must be specified in the PCX to TIFF conversion configuration parameter (for information on how to do this see Brooktrout Fax Interface Tool).
The conversion utility must adhere to the following command syntax:
<pcx-tiff-utility-name> <filename.pcx> <filename.tif>Note that the PCX files themselves must have .pcx as their file extension.
When a .lst file is processed, an initial check is made to see whether the file exists and can be read. If it cannot, an error is reported; otherwise, the file is opened and each line of the file is read and checked. The checks are to ensure that the file specified by the line exists, can be read, and has a supported file extension (that is .tif, .txt and .pcx, but a list file within a list is not supported). If any of the files do not exist, an error is reported and the whole job is abandoned (even good files are not transmitted in this case).
The list file is then processed, by creating an array of .tif files to be sent. For each file in the list, if it is a .tif file then the file name is just added to the array. If it is a .txt file then a temporary .tif file name is created and added to the array and the .txt file is converted (in accordance with the method specified above for a single .txt file). If the file cannot be converted, an error is reported and the transmission of the list is terminated.
Once all the lines in the list file have been read and added to the array, the entire array (of .tif files) is sent using the Brooktrout API. If a problem is detected while sending the fax, an error is reported. At this point any temporary .tif files are then deleted.
In addition, many of the error codes corresponding to values of CA_errno may be returned in the variable device_rc if an invocation by the custom server of one of the CA_XXX family of functions fails for some reason. These error codes start at value 51 (50 is actually the first code but as this represents the 'no error' case it will never actually be seen). For an explanation of these error codes, see Blueworx Voice Response for AIX: Custom Servers, "Error Return Codes".
On return from BFAX_SEND_FAX for queued requests (callback_st not null) device_rc will be set to 0, and device_state set to 7 (QUEUED). If device_state is set to -1, fax queuing failed and device_rc should be checked for the failure reason.
BFAX_SEND_FAX also allows immediate faxing (no queuing). For immediate operation, callback_st must be set to null. The status of an immediate send fax operation is returned in device_rc and device_state. On return, for immediate SendFax request (callback_st = null), device_rc will be set to 0, and device_state set to 8 (SENT). If device_state = -1, immediate fax send failed: check device_rc for failure reason.
SendFax can be invoked again when control returns to the application state table. If device_state does not = 7 (QUEUED) or 8 (SENT), this does not prevent the application state table from retrying the SendFax operation.
<One or two digit record number><comma></full-pathname/filename>For example:
01,/myfax_directory/fax01.tif 02,/myfax_directory/fax02.tif 03,/myfax_directory/fax03.tif
Record numbers must start at 1; they must be sequential and unique — duplicate record numbers are not allowed.
Listfiles can be used on immediate or queued send-fax requests to send a list of faxes within the context of a single call. Verification (existence and accessibility check) of each file within the list is performed prior to processing any files in the list. If verification fails, listfile processing is terminated, device_rc will be set to the appropriate value see Return codes and device_state will be set to -1. If unrecoverable errors occur during transmission of a listfile, the fax operation will terminate, device_rc will be set to the appropriate error code, and device_state will be set to -1 (FAIL).
Prerequisite: An available Blueworx Voice Response channel and enough file system space to create fax-record-file(s) for requested fax operation.
Queued faxes are processed in First-In-First-Out (FIFO) order.