Add Image Programmatically

$add_image imagenumber

This command causes an image to be added to the list of fax-on-demand images to be transmitted.  $add_image is a low-level command which is designed for special applications only. The normal method of adding an image to the list is to transfer to it using $next_box, (or for the caller to enter the image number when prompted by standard voice prompt 4).

The $add_image command is only used when the image to be sent is not entered by the caller and must be looked up, computed, or constructed.

The parameter on this command is used as follows:

imagenumber the image number to be added, which may be specified as a variable using the normal @ syntax.

When $add_image is used to add an image, the image number bypasses any look-up operation which may be specified.

When the image has been added successfully, a control variable named ADDOK is created with the value of the image number. If the addition fails (for example because the image file does not exist or the $max_image limit is reached), then the value of the variable is set to "INVALID" or "LIMIT". You can use $if to compare @ADDOK with the number you have just added to check the success of the operation.

Example:

The following example builds an image number from two parts in separate variables (presumably obtained earlier using $get_var) and then adds the image using the combined document reference:

$type decision

$set_var myimage @part1 ; build image # from part1

$set_var myimage |@part2 ; and part2 concatenated

$add_image @myimage

$if @addok = @myimage

$next_box 123 ; added successfully

$else

$next_box 999 ; addition failed

$endif