Collect User Info
After authenticating the caller we are going to ask them to choose the room that they want to reserve. To accomplish this, we are going to use a Java action.
Collecting Room Choices
To get all of the options, we are going to create a sequence of digits elements to get the room #, date, time, etc... The first element will be The prompt asks for a 3 digit room number. In the tab of properties, specify a fixed length of digits.
We need to save the room number in the next element. Create a YYYYMMDD, with the fixed length of 8 digits.
element. Add a prompt asking for the date. We asked for the formatWe now have two elements asking for numbers, but we haven't stored that input in any variable yet. We will ask for the room number in
, but we will save it in the element. In , add a action.Do this for the other room options you want to collect.
The last element,
saves the user input for . We will add other actions in the next step.The Java Program
The
element handles making reservations in the database. Add a action so it can handle more complicated database access. A java program is included in the package:You can write your own Java program if you wish. Write the Java program as usual. The only requirement is that the return type of the Java program should be
if there are multiple name value pairs that need to be returned. The name value pairs can be then accessed from your IVR application in IVR Studio. Simply use the dot notation to access the value, such as: , where is the name for the Java action, and is one of the name value pairs returned.To invoke a particular method of the class, simply specify it in the
action.You must also specify the arguments or parameters for the method when you are creating the
action. The argument must be specified with the actual Java class name, such as , and the value to pass in.The file directories may be different on your computer.
Set More Variables
Set two more variables.
Application So Far
To see the IVR application up until here, open beginning of this lesson.
in the package provided at the