Cisco Cisco Customer Voice Portal 8.0(1) Developer's Guide

Page of 122
Recommendations Include:
The interaction category of the activity log is used to record the activity of callers within the
VoiceXML pages produced by voice elements. Since this activity occurs on the voice browser,
the only way to record this in the VXML Server logs is to store the appropriate information
within the VoiceXML and submit it back to VXML Server. Unified CVP defines an interaction
logging convention for recording caller behavior within the VoiceXML. By conforming to
this convention, the developer ensures that the activity log will contain the detail expected
for application testing and reporting.
While interaction logging is not required in a custom voice element, not performing logging
will reveal nothing about what the callers did within the element. See the section entitled
 for more information. A full description of the activity log
 (http://www.cisco.com/en/US/products/sw/custcosw/ps1006/
products_user_guide_list.html).
Try to produce VoiceXML that conforms to the VoiceXML specifications, understanding
that using browser-specific functionality will prompt that element to function correctly only
on that browser.
Throw an 
ElementException
 where appropriate so an error logger event can be thrown.
Exceptions should indicate the voice element encountered a situation which prevents it from
doing its assigned task. Non-fatal exceptions should be caught within the voice element (and
possibly linked to exit states) and warnings placed in the error log.
Do not end the call in the voice element manually using the 
<exit>
 or 
<disconnect>
 tags.
Instead, exit the voice element with a specific exit state that can then be linked to a hang-up
element in the call flow. If it must be done, use 
<disconnect>
 so that VXML Server can
detect the hang-up and execute the on end call action. Using 
<exit>
 would cause VXML
Server to not know the calls had ended, using up an VXML Server port until it times out on
its own. This is obviously not a desirable situation.
A voice element can add any Java object to scratch space via the 
setScratchData()
method in 
VoiceElementData
. Scratch data is used for voice element internal uses only
since the scratch space is cleared when the voice element ends, even if it is revisited in the
same call. Additionally, the data in the scratch space is stored in the session managed by
VXML Server. To minimize performance issues, placing large Java objects in the scratch
space is not suggested.
VoiceElementBase Methods
A voice element extends the abstract Java class 
VoiceElementBase
 found in the 
com.audium.
server.voiceElement
 package. Like other elements, it shares methods obtained from the
base class ElementBase described in the previous sections. 
VoiceElementBase
, however,
adds many additional methods that apply to voice elements only. Its execution method is also
more complex.
Execution Method
Programming Guide for Cisco Unified CVP VXML Server and Cisco Unified Call Studio Release 8.0(1)
63
Chapter 9: Configurable Elements
Voice Elements