Clean up orphan FS files
(cannot be run directly from a command-line)
The CLEARACTIVE utility is provided for special use when directed by Copia support, to clear up any FS files left active when a CopiaFacts node has terminated abnormally and cannot be used to perform the clearance itself. Its functionality is replicated internally in the following circumstances:
•before a node is started up in the COPIAFACTS program,
•in most situations of the COPIAFACTS engine terminating abnormally, and
•by OMACHECK when the failure of a node is detected.
The normal processing done by CLEARACTIVE first involves a scan of all the .FS lock files in the ACTIVE folder, to find those which 'belong' to the node. For each, the corresponding real FS file is found if present in any of the TOSEND folders. Any FS with a $fax_status1 value of 3 (indicating that a fax, voice or e-mail outbound operation was in progress) has the status set back to 2 (indicating 'ready') and an $attempt_record appended with failure code 66. If there are already three code 66 attempts in the file, it is moved to FAIL, also with a failure code of 66. Because the CopiaFacts node will not be running at the time, no postprocessing is done for such failures. This situation would only arise if a node was repeatedly started and failed while processing the same FS file.
When enhanced FS file processing is enabled, CLEARACTIVE will instead scan the WORK folder for the node, and will perform similar processing to update the status value before moving the file back to its original location. In the rare case where the engine fails in the very short interval when the WORK FS file has been updated in preparation to be moved to SENT, FAIL, or back to TOSEND folder for retry, but the move has not been done, the move is performed instead by the CLEARACTIVE processing.
The CLEARACTIVE processing also clears from the ACTIVE folder any files named with the dialed phone number (which block other nodes from calling the same number) which belong to the node being dealt with.