Enable the use of LOOPEXIT.IIF

$loop_exit

This command enables the use of the LOOPEXIT feature. When enabled, CopiaFacts searches for and executes the commands in an infobox named LOOPEXIT, after each document selection and when selection is ended, either by the system or by the caller. This feature enables you to add custom processing to the main CopiaFacts fax-on-demand document selection loop. You will need to specify an alphabetic range in $script_locn that includes LOOPEXIT.

Note that this command is now deprecated and has effectively been superseded by $set_state which can inject a sequence of infoboxes at any point in a transaction.

This command has no parameters.

Typical applications of this feature include: confirming to the caller how many pages have been selected so far; warning of the approach of the $max_request or $max_image limit; telling the caller that the image limit has been reached; overriding the image limit for special callers; detecting when the caller is done selecting documents; or telling the caller roughly how long it will take before you start sending the requested documents.

The LOOPEXIT infobox must be coded as $type decision and you should normally use $next_box to transfer control from control from box to box while you are processing the "exit". When your processing is complete, you must use $next_box to transfer to state 7 (LOOP_RETURN).

A system variable named LOOPEXIT is provided to condition your exit operations. This variable will have one of the following five values when control is transferred to your LOOPEXIT infobox:

1 The caller has not selected any images yet
2 Some images have been selected; limits not reached
3 The maximum image limit has been reached
4 The maximum request limit has been reached
5 The caller has responded to standard voice prompt 7 (more images?) in the negative, or has keyed 0 in a menu which has no $next_box defined (and no menu exit state).

When you transfer back to LOOP_RETURN state (using "$next_box S7") the following action will be taken depending on the state of the LOOPEXIT system variable:

1 Standard voice prompt 4 will be played (Enter a document number..)
2 Standard voice prompt 7 will be played (0 to receive now, 1 to select more images)
3-5 End selection.

Any other values are treated as 2

Note that these actions correspond exactly to what happens if the LOOPEXIT exit is not taken. The CopiaFacts processing for "end selection" depends on what other options are in force. The system will as necessary process credit card (play total and get card info), get the caller phone number if specified, invite a spoken message if specified, get fax phone details when $fax_phone_last is in force; or simply save a callback request or start a one-call transmission.

Note that if you fail transfer to a valid $next_box infobox or state during your exit processing, an unexpected loop exit may be taken again and you may find that the caller is left in an endless loop. Please test the infoboxes you write before going live with them! Note also that if you return with LOOPEXIT value 2 and the caller then decides to terminate selection, your exit infobox will then be called again with LOOPEXIT value 5.

Example:

$loop_exit