ivr IVR Tutorial Table of Content << Previous  >> Next

8.5 Use Action Return Variable

Both Java action and HTTP action 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 Select Call List element, 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 broadcast will start only the caller selects a valid call list. (Here we assume less than 10 call lists so caller can press a single key to select)

Add an All Else Element

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

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

 

 
ivr IVR Studio Table of Content << Previous >> Next