Cisco Cisco Unified Customer Voice Portal 10.0(1) Guía Del Desarrollador
C
HAPTER
9:
C
ONFIGURABLE
E
LEMENTS
P
ROGRAMMING
G
UIDE FOR
C
ISCO
U
NIFIED
CVP
VXML
S
ERVER
AND
C
ISCO
U
NIFIED
C
ALL
S
TUDIO
R
ELEASE
4.1(1)
59
Interaction logging is best explained though several examples. The first example wishes to add to
the interaction log the fact that the xyz audio group was played. The VoiceXML necessary to
produce this logging as per the specified convention would be:
the interaction log the fact that the xyz audio group was played. The VoiceXML necessary to
produce this logging as per the specified convention would be:
<assign name="audium_vxmlLog" expr="audium_vxmlLog+'|||audio_group$$$xyz^^^' +
application.getElapsedTime(audium_element_start_time_millisecs)"/>
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.
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
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:
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)"/>
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 Cisco Unified CVP VXML Server and Cisco Unified Call
Studio for more detail about the different logs VXML Server records and the data that can appear
in the logs.
Studio for more detail about the different logs VXML Server records and the data that can appear
in the logs.