All variables in the Xtend IVR scripting language starts with a '$' sign. Variable names are not case sensitive and should be composed of an initial letter followed by combinations of letters, numbers and underscore. The standard convention is to use a combination of upper and lower case characters for the variable names.
$Login = "Testing"
$MaxTries = 10
are certain pre-defined (reserved) variables, which the user should
not modify. The values contained in these variables are changed by Xtend IVR
itself and contain information regarding the origin of the call and the state
of execution of the script. These variables are:
Gives the path where Xtend IVR is installed.
Type of call - Normal, Redirect, RedirectBusy, RedirectNoReply or RedirectUncondititional.
line identification that was received.
date expressed as dd/mm/yyyy.
Will be 1 if running under Developer mode and 0 if running under Standard mode.
Sets the precision for all floating point numbers used by Xtend IVR.
A unique ID
for each incoming line.
Name of the currently active channel/port in the voice driver.
of this variable will be automatically added
to all the display commands.
Name of the Voice driver used.
error messages if any from the previous operation.
The exit code
of program executed by the last RUN command.
Mode of Input - Pulse, Tone or Speech Recognition.
The last key
pressed by the user.
Name of the active Log file.
arguments to the Plugin.
from the Plugin.
Path of the recorded file.
of times the phone has rung.
Redirect line Identification when the call is diverted.
The name of
time expressed as hh:mm:ss.
of time remaining for script termination.
The name of
parameter file containing the list of variables.
variable gives the wav file directory if not found in any of the current
directory, ivr directory, wave directory or in the script directory.
Password of the encrypted wave file.
the version of Xtend IVR.
Following arithmetic operations are possible. Expression containing more than one arithmetic operator are however not currently supported.
$A += 1
$B -= 1
$C = $A + $B
$C = $A - $B
$C = $A * $B
$C = $A / $B
Following string operations are possible. For detailed information about the built-in functions please refer Functions.
$A = "ABCDEF"
$B = len($A)
$C = mid($A,1,1)
$A = "Try"
$B = "This"
$C = concat($A,$B)
Variables can be used at any point where a string or numeric literal is required. Other than this, variables are also supported by an IF statement which allows branching based on the result of the comparison. All variable values including numbers are internally stored as strings and therefore all string operations can also be implemented on numbers and will have the expected results. When dealing with variables following points should be noted.
String variables even if no explicit assignment operation has been performed.
$A = 650
$B = "200XYZ"
$C = $A + $B will result in $C having the value 850.
$A = 650
$B = "XYZ200"
$C = $A + $B will result in $C having the value 650.
Booleans are used to denote the result of a logical operation. It is the logic that computers use to determine if a statement is true or false. A boolean can be either TRUE or FALSE.
A bool value can be promoted to an integral type. A bool value of TRUE is promoted to the value 1, whereas a boolean value of FALSE is promoted to the value 0.
The result of the equality, relational and logical operators is either of the boolean constants true or false.
Xtend IVR facilitates to check a boolean value in loops and conditional statements as shown below: