Cisco Cisco Unified Customer Voice Portal 11.0(1) User Guide

Page of 107
C
HAPTER 
2:
 
V
OICE
XML
 
S
ERVER 
C
OMPONENTS IN 
D
ETAIL
 
 
V
OICE
XML
 
S
ERVER 
U
SER 
G
UIDE 
 
 
 
FOR 
C
ISCO 
U
NIFIED 
C
USTOMER 
V
OICE 
P
ORTAL 
R
ELEASE 
4.0(1) 
 
 
 
 
 
41
Notes: 
    The ability to use a standard ampersand in the root document URL instead of escaping it (as 
“&”) is voice browser dependent. Most browsers will accept the escaped version so try 
that first. 
    If the insert element does not need to send back any data in the 
namelist
 parameter, only the 
element_log_value
 variable need be included (the parameter should look like this: 
“...
namelist=element_log_value
”). 
Example 
In the example below, a block is used to log the playing of the 
initial_prompt
 audio group. 
After this action, some inputs passed to it from VoiceXML Server are played. Once this is done, 
it creates two element variables named 
var1
 and 
var2
 and a session variable named 
sessvar
After this, it goes through a field that catches a number and when done saves the utterance to the 
activity log and returns the exit state less if the number is less than 5 and greater_equal 
otherwise. The 
<return>
 tag returns the exit state, log variable, the four variables from the root 
document (error, hotlink, hotevent, and action), the two element data variables, the session data 
variable and a custom log entry (the number captured). Also note that these last four variables 
are also passed to the root document call in the 
<vxml>
 tag so that events triggered within the 
insert element will correctly pass the data if it was captured by then. Note that the VoiceXML 
listed below may not function on all browsers without modification. 
<?xml version="1.0"?> 
<vxml version="1.0" 
application="/CVP/Server?audium_vxmlroot=true&amp;calling_into=MYAPP&amp;namel
ist=element_log_var1|element_nolog_var2|session_sessvar|custom_custlog"> 
 <form 
id="testform"> 
 
 
<block>This is the initial prompt 
   <assign 
name="audium_element_start_time_millisecs" 
expr="new 
Date().getTime()"/> 
   <assign 
name="audium_vxmlLog" 
expr="'|||audio_group$$$initial_prompt^^^' 
+application.getElapsedTime(audium_element_start_time_millisecs)"/> 
  </block> 
 
 
<block>In the VoiceXML element. 
 
 
The ani is <value expr="audium_telephony_ani"/>. 
    
The element history is <value expr="audium_history"/>. 
 
 
User by ani num calls is <value expr="user_by_ani_num_calls"/>. 
 
 
Element data foo from element first <value expr="audium_first_foo"/>.  
 
 
Session variable foo2 <value expr="audium_session_foo2"/>. 
  </block> 
 
 
<var name="element_log_var1" expr="'log me'"/> 
    
<var name="element_nolog_var2" expr="'do not log me'"/> 
  <var 
name="session_sessvar" 
expr="'session_data_value'"/> 
  <field 
name="custom_custlog" 
type="number"> 
   <property 
name="inputmodes" 
value="voice" 
/> 
   <prompt>Say 
number.</prompt> 
   <filled> 
    <assign 
name="audium_vxmlLog" 
expr="audium_vxmlLog 
'|||utterance$$$' + custom_custlog.$utterance + '^^^' 
+application.getElapsedTime(audium_element_start_time_millisecs)"/>