Advanced IVR Tutorial Lesson 1: Use Action Return Variable

Both Java and HTTP actions expect returns of name value pairs. Each action has a return variable associate with it. For example, the GetList action defined here has the following name value pairs:

promptmsg=Please press 0 for mylist A; press 1 for mylist B
list="C:\Call List\mylist A.voc" "C:\Call List\mylist B.voc"
total=2

There is no limit on the number of name value pairs that a return variable can have.

The action return variable can be accessed using the name of the action and the name of the name value pair. A dot notation is used to represent an action return variable. For example, GetList.total is used to represent the total number of call list files. Within IVR Studio it can used as any other variable, such as in a variable prompt item.

Set Action Return Variable as Prompt Item

Select the Select Call List element then add the following prompt item:

The action GetList is defined for the same element. Since all actions of an element are executed before any prompt is played, the GetList action return variable is available for using as a prompt item. Here we use the returned promptmsg (please press 0 for ...) as the prompt message for the element.

Use Action Return Variable in Transition Condition

Select Start Broadcast element, select the properties button on the program toolbar. From the General tab, select If the condition is met and enter the following condition: "__VG__LAST_RESULT__ < GetList.total"

Here the condition ensures that a broadcast will start only when the caller selects a valid call list. (Here we assume there are less than ten call lists so the caller can press a single key to select)

Add an All Else Element

When a caller enters the wrong choice for a call list, the system goes back to the Select Call List element again to prompt the user for another selection.

Select Select Call List element and add a child element that is a jump element. Select the radio button labeled Always true from the General tab.