Accessing State Table System Variables using VXML

Technote (FAQ)


Question

How do I access the information stored in state table system variables from a VXML application

Answer

This technote explains how VXML programs are able to access the system variables associated with state tables. It provides examples of the VXML and state table code required to accomplish this.

The state table system variables provide information to state table applications that in many case are not provided with VXML.

If data is required from system variable SV542 (call data) such as original called number or redirecting number then the state table that executes the AnswerCall state table action (by default Incoming_Call state table) must be modified to save the contents of SV542 to another user (string) system variable. (such as SV51) prior to the AnswerCall state table action being executed.

Access to a state table is achieved from VXML using an <object> tag within a form. The example VXML code shown in figure 1. contains a single form that accesses two state tables, GetCallData (Figure 2) to request the redirecting number value and then vxmllogger (Figure 3) to log the value of the redirecting number.

Each state table is invoked using an <object> tag, with parameters being passed within an array. The parameters passed into the state table are set with return values for return to the VXML application as properties of the object. See the calldata parameter within GetCallData state table (Figure 2) for an example of how a return value is set within a state table and the log1 object in Figure 1 where it is accessed as calldata.parms[0].

While this example shows the use of state tables to access system variables it is also possible to create multiple state tables to act as an interface to an existing custom server from a VXML application. Typically each state table would provide an interface to a single custom server function.

For state table invocation the object tag supports the following parameters:
setName (string) - name of the state table to invoke
setEntryPoint (string) - entry point with state table
setParms (string) - an array of parameters

and the following object properties are set:
"object name".completionCode;
"objectname".completionCodeText;
"objectname".returnCode;
"objectname".parms.length; // number of returned parameters
"objectname".parms[0];
"objectname".parms[1]; ...


Example Code Follows:

<?xml version="1.0" encoding="iso-8859-1"?>
<vxml version="2.0">
   <form id="rdnis">
      <object name="calldata"
        classid="method://com.ibm.speech.vxml.BeanWrapper/invokeStateTable">
      <!--identify the state table name and entrypoint -->
         <param name="setName" value="GetCallData"/>
         <param name="setEntryPoint" value="start"/>
         <!-- GetCallData expects input in ISO8859-15 -->
         <param name="setEncoding" value="ISO8859-15"/>
         <!--specify the parameters to the state table -->
         <param name="setParms" expr="new Array('REDIRN')"/>
      </object>

      <object name="log1"
        classid="method://com.ibm.speech.vxml.BeanWrapper/invokeStateTable">
      <!--identify the state table name and entrypoint -->
         <param name="setName" value="vxmllogger"/>
         <param name="setEntryPoint" value="start"/>
         <!-- GetCallData expects input in ISO8859-15 -->
         <param name="setEncoding" value="ISO8859-15"/>
         <!--specify the parameters to the state table -->
         <param name="setParms" expr="new Array(calldata.parms[0])"/>
      </object>
   </form>
</vxml>
Figure 1 – Example VXML Code Invoking 2 state tables


#
# =================================================
# Description
# GetCallData state table
# In order for this state table to work the default IncomingCall state
# table must have been modified to copy the contents of SV542 (call
# data) into SV51 prior to the AnswerCall state table action.
# =================================================
# Prompt Directory
#
# =================================================
# Entry Point(s)
ENTRY_POINT(start,Begin);
#
# =================================================
# Variables
INPUT STRING calldata;
LOCAL STRING tempstring;
#
# =================================================
# Actions
    Begin:     DoNothing("0");

    AssignData(tempstring, "GET_TAG_VALUE", SV51, calldata);
    AssignData(calldata, "ASSIGN", tempstring);

    "log call parameters"
    AssignData(SV52, "CONCATENATE", "FILE=incoming:getcalldata=", calldata);

    LogEvent(VAR_UNDEFINED, SV52);
   
    ExitStateTable(0);
Figure 2 - GetCallData state table


#
# =================================================
# Description
# vxmllogger state table
# =================================================
# Prompt Directory
#
# =================================================
# Entry Point(s)
ENTRY_POINT(start,begin);
#
# =================================================
# Variables
INPUT STRING instring1;
LOCAL STRING calldata;
#
# =================================================
# Actions
    begin:     DoNothing("0");

    "log call parameters"
    AssignData(calldata, "CONCATENATE", "FILE=vxmllogger:string1=",  
               instring1);

    LogEvent(VAR_UNDEFINED, calldata);

    ExitStateTable(0);
Figure 3 - vxmllogger state table

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

WebSphere Voice Response for AIX
WebSphere Voice Response

Software version:

4.2

Operating system(s):

AIX

Software edition:

All Editions

Reference #:

1282000

Modified date:

2012-12-11

Translate my page

Machine Translation

Content navigation