$pre_process [USR, UJP]
Specify a Pre-processing Command
This command specifies that you wish to hook into the fax delivery process by performing custom pre-processing before the requested fax is sent. For a fax-on-demand callback request, CopiaFacts creates from this command a $fax_pre-process command in an FS file. You may specify up to eight separate pre-process operations, and multiple operations with the same method of processing will be performed in sequence.
In a .USR file, this command has no effect on fax broadcasts nor on any server operations using externally generated FS files. It only affects the contents of a callback FS file generated from a fax on demand or fax mail retrieval request.
In a .UJP file, using this command is equivalent to specifying the $fax_pre-process command in every FS file of the job.
The parameters on this command are used as follows:
|command||the name of an operating system command, program, or batch file that will be executed to initiate pre-processing; or an infobox name for infobox method processing. A program or batch file name must have a file extension if its extension is not .EXE. Operating system commands should be preceded by CMD /c.|
|method||one of the following keywords:|
|internal||COPIAFACTS will invoke (spawn) the specified pre-processing command with the following program arguments:|
The full name of the FS file to be processed
The FS file number only with no extension
The call number of the call creating the FS request
The directory that contains the TOSEND, SENT, and FAIL directories
|internalNT||internal pre-processing will be done as for the internal keyword, but the FS file will not be selected for processing on a system which is not running under Windows. No other pre- or post-process should specify the internalDOS method, or FS file will not be processed.|
|internalDOS||internal pre-processing will be done as for the internal keyword, but the FS file will not be selected for processing on a system which is not running under DOS. No other pre- or post-process should specify the internalNT method, or FS file will not be processed.|
|FFEXTERN||pre-processing will be performed under the control of the FFEXTERN process manager. FFEXTERN handles the detection and selection of files which require pre-processing and calls a supplied or user-written program to perform the processing.|
|external||pre-processing will be performed by some external process (not supplied), running on a networked system. CopiaFacts will wait for any external processing to be completed before attempting to send an outbound request that is marked for pre-processing.|
|infobox||control will pass to an infobox sequence, which MUST be terminated by a transfer to state IIF_PROC_COMPLETE (s191). Either $next_box or $chain can be used to transfer to this state.|
Internal pre-processing has the disadvantage of suspending fax and voice operations on the channel for the duration of the pre-processing. You may change the current drive or directory during the execution of your 'internal' program or batch file and they will be restored by COPIAFACTS on return.
An external pre-processor must monitor outbound request files to determine which, if any, files are ready for it to process. The $fax_pre-process command in the request file should be checked for a matching pre-process command. Additionally, the $fax_status1 command should be checked for a value of zero (awaiting pre-processing). Once the pre-processor begins processing the request file, it should update the status to 1 (pre-processing in progress). The pre-processor may modify the request file variables, change the images to be sent, change transmission dates and times, change the fax number, cover sheet, and any of the other information contained in the request file. It may even delete the request. After pre-processing is completed and the request is ready to send, the status must be updated to 2 (ready to send).
Infobox preprocessing can be used for operations such as calling an external DLL or program from an infobox. The user profile or user job properties file referenced from the FS file must have one or more $script_locn commands to locate the infobox file(s). Your infobox logic must finish by transferring to state 191 (IIF_PROC_COMPLETE) to continue the call, or to state 121 (ABORT_CALL) to cancel the further processing of the FS file. In the latter case it will fail with status 61, pre-process failure, but you can override this by assigning an error code to the FS_PREFAIL and returning to state 191 (IIF_PROC_COMPLETE).
Voice operations within your infobox sequence will be ignored, and transfer to any other state may cause unpredictable results. The FS_... system variables contain specific data pertaining to the active FS file, but any valid system variables may also be used. Any program or DLL called from the infobox sequence should not attempt to modify the FS file other than via the FS... variables.
Pre-processing performed internally by program
$pre_process \\FFSERVER\COPIA\faxfacts\getfax internal
Pre-processing performed externally by the PREPRO program
$pre_process prepro external