MCF File Post-Receive Processing
Processing is specified by means of a $post_receive command in the applicable mailbox. The infobox sequence is called after a fax has been successfully received. The keyword infoboxall results in the infobox sequence also being called after a failed fax receive operation.
Typical applications include:
|fax-to-email:||sending an e-mail with the received fax as an attachment.|
|confirmation:||reporting a received fax|
|Note that you should not perform lengthy operations as part of your infobox post-receive infobox processing. On a heavily loaded system this can tie up the CopiaFacts channel and perhaps cause a subsequent incoming call to be missed. Instead, you can quickly write a worker-box FS file which can be processed (perhaps by another node) after the receive line has been cleared to accept another call. See this example.|
Post-receive processing can also be performed by FFEXTERN ('external' post-receive) which scans the MCF files which will have been placed in the same folder as the received TIF file. User-written applications can also scan the MBX files to locate message folders (see $message_dir) and then MCF files in those folders, to process incoming faxes independently.
Variables defined in the USR file for the fax receive operation are available, as are the set of PR_... variables which provide the results of the inbound fax operation. For example:
|PR_FAXPATH||might contain \\SERVER\COPIA\FAXFACTS\MAIL\MESSAGE\01234567.TIF|
|PR_FAXFILE||might contain 01234567.TIF|
|PR_FAXPDF||might contain 01234567.PDF|
|PR_FAXCSID||might contain SENDER TSI|
|PR_MAILBOX||might contain 9876 To get the filename with leading zeros, use $set_var ZBOX @PR_MAILBOX 0 8|
Post-receive processing often requires writing an FS file from a $type FS infobox. Follow that link for examples.
Converting received faxes to PDF
Do not attempt to convert received faxes to PDF in a Post-Receive Process. If you get a multi-page fax to convert, this will tie up the incoming line for a while after the call has already been released by the caller, and on a loaded system this will cause incoming calls to be lost.
Instead, for fax-to-email applications, just specify a content type of application/pdf for the TIF e-mail attachment. This will automatically convert the TIF to PDF on the fly, just before the e-mail is sent.
For other applications where you need to save a PDF file from the received TIF, you can 'manually' convert the file. There are three ways to do this:
•You can use the CreatePDFThumbnails function in the Application Support DLL. This can be set to use one PDF page for either one or multiple pages of the incoming TIF, and allows space for three lines of text (for example confirming date and time of receipt) at the top of each output PDF page.
•You can use a $run box to call GCSINGLE. This is a significantly less efficient and more complicated means of doing the same operations as ConvertFile.