Cisco Cisco Customer Voice Portal Downloads Developer's Guide

Page of 79
C
HAPTER 
9:
 
C
ONFIGURABLE
 E
LEMENTS
 
 
C
ISCO 
CVP V
OICE
XML 3.1
 
 
  
Programmer 
Guide 
 
<assign name="audium_vxmlLog" expr="audium_vxmlLog+'|||audio_group$$$xyz^^^' + 
application.getElapsedTime(audium_element_start_time_millisecs)"/> 
Note that the 
expr
 attribute of 
<assign>
 is used because the value is actually an expression that 
concatenates various strings together.  First, the 
audium_vxmlLog
 variable must be listed because 
we are appending new data to it. We append the string listing the audio group action and the 
name of the audio group, all contained within single quotes because this is a string literal. The 
final part is the Javascript, which cannot be within single quotes. 
To do this within a voice element, one would have to use the 
VAction
 object (since it handles the 
<assign>
 tag) like this: 
VAction log = VAction.getNew(pref, VAction.ASSIGN,  
  
VXML_LOG_VARIABLE_NAME, 
 
VXML_LOG_VARIABLE_NAME + "+'|||audio_group" + 
 
"$$$xyz^^^' + application.getElapsedTime(" + 
            
ELEMENT_START_TIME_MILLISECS + ")",  
 VAction.WITHOUT_QUOTES); 
Note that the 
audium_vxmlLog
 and 
audium_element_start_time_millisecs
 variables are not 
mentioned by name, the 
VXML_LOG_VARIABLE_NAME
 and 
ELEMENT_START_TIME_MILLISECS
 Java 
constants are used instead. Where Java constants are used, they must appear outside the double 
quotes defining the string. Also note that 
pref
 is expected to be a valid 
VPreference
 object. 
In a more complex example, the utterance of a field named xyz is to be appended to the log. The 
utterance is determined by a VoiceXML shadow variable. The VoiceXML would look like: 
 
<assign name="audium_vxmlLog" expr="audium_vxmlLog + '|||utterance$$$' + 
xyz.$utterance + '^^^' + application.getElapsedTime( 
audium_element_start_time_millisecs)"/> 
and the 
VAction
 object would be configured like: 
VAction log = VAction.getNew(pref, VAction.ASSIGN,  
  
VXML_LOG_VARIABLE_NAME, 
 
VXML_LOG_VARIABLE_NAME + "+'|||utterance" + 
 
"$$$' + xyz.$utterance + '^^^' + " + 
 "application.getElapsedTime(" 
 
ELEMENT_START_TIME_MILLISECS + ")",  
 VAction.WITHOUT_QUOTES); 
See Chapter 5 in the User Guide for more detail about the different logs CVP VoiceXML Server 
records and the data that can appear in the logs.
 
 
Copyright 2001 - 2005 Audium Corporation.  All Rights Reserved. 10/05
 
64