• No results found

Events and Errors

In document Cisco VoiceXML Programmer s Guide (Page 66-69)

Cisco VoiceXML supports the events and errors listed in Table 1-7.

Table 1-7 Events and Errors Supported by Cisco VoiceXML

Error Event Description

error.unsupported If you use regex grammar with a version 2.0 VoiceXML document or, if you specify DTMF grammar without specifying the DTMF option and do not configure the ASR server, then the

interpreter throws an error.unsupported event. When a platform does not support a specific sequence of audio URI or codecs, or prompt elements, the interpreter throws an

error.unsupported event.

Note A VoiceXML document throws an error.unsupported event even if you have pure DTMF grammar.

error.condition.baddestination When an invalid number is used for a transfer element, the interpreter throws an

error.condition.baddestination event.

error.badfetch When a media server cannot reach or fetch a URI that is specified in the speech markup or in the grammar, the interpreter throws an error.badfetch event.

error.unsupported.language If the media server is configured but does not support the requested language, then the platform throws an error.unsupported.language event. error.unsupported.format If the media server is configured but cannot

process the grammar or speech format that is used by the document, an error.unsupported.format event is generated.

disconnect.com.cisco.handoff If the destination application does not return the call leg but disconnects it, the VoiceXML

interpreter throws a disconnect.com.cisco.handoff event to the VoiceXML application and the call is handed off to another application using the <object> element.

If the return flag is FALSE, indicating a nonreturnable handoff, then the VoiceXML interpreter throws a disconnect.com.cisco.handoff event to the VoiceXML application.

error.com.cisco.handoff.failure If there is a failure in handing off an application; for example if the application is not preconfigured or built-in, or if it cannot be loaded, then the interpreter throws an

error.com.cisco.handoff.failure event to the VoiceXML application.

error.unsupported.object If the platform specific function

com.cisco.callhandoff is not supported, the interpreter throws an error.unsupported.object event to the VoiceXML application.

Note In VoiceXML 2.0 and later versions, this event is replaced by

error.unsupported.objectname.

error.com.cisco.aaa.authenticate.failure This error event is generated if there are server errors, for example, when the RADIUS server is unreachable.

error.com.cisco.aaa.authorize.failure This error event is generated if there are server errors, for example, when the RADIUS server is unreachable.

error.noauthorization This error event is generated when the application tries to perform an operation that is not authorized by the platform.

error.noresource This error event is generated when a run-time error occurred because a requested platform resource was not available during execution and when playing prerecorded files from the router fails. In versions earlier than VoiceXML 2.0, the equivalent events are

error.com.cisco.media.resource.unavailable, error.com.cisco.resource.failure.asr,

error.com.cisco.resource.failure.tts, and error.badfetch (for failure playing prerecorded files from the router). These events are supported for backward compatibility.

Table 1-7 Events and Errors Supported by Cisco VoiceXML (continued)

Cisco VoiceXML provides a set of default event handlers if no appropriate event handler is specified in the VoiceXML document or in the root document; these are summarized in Table 1-8.

Note For event typesusing default event handlers, no audio is provided.

Note If the behavior of a catch handler is specified as an error event in a VoiceXML document, the VoiceXML interpreter does not exit after executing the catch handler; it allows the developer to use another VoiceXML document. For example, you can play a different prompt on a different server instead of exiting the interpreter.

error.unsupported.objectname This error event is generated when the platform does not support the object.

Note In versions earlier than VoiceXML 2.0, the equivalent event is

error.unsupported.object, which is supported for backward compatibility. connection.disconnect.hangup This event is generated when the user hangs up.

In versions earlier than VoiceXML 2.0, the equivalent event is telephone.disconnect.hangup, which is supported for backward compatibility. connection.disconnect.transfer This event is generated when the user is transferred

unconditionally to another line and will not return. In versions earlier than VoiceXML 2.0, the equivalent event is telephone.disconnect.transfer, which is supported for backward compatibility.

Table 1-7 Events and Errors Supported by Cisco VoiceXML (continued)

Error Event Description

Table 1-8 Event Types Using Default Event Handlers

Event Type Action

cancel Does not reprompt error Exits interpreter error.noauthorization Exits interpreter exit Exits interpreter help Reprompts noinput Reprompts nomatch Reprompts telephone.disconnect Exits interpreter All others Exits interpreter

JavaScript Support

Cisco VoiceXML supports ECMAScript Specification 3.0 (Standard ECMA-262, ECMAScript Language Specification, 3rd edition, August 1998, available at http://www.ecma.ch/), approximately equivalent to JavaScript 1.5 with the following exceptions:

Built-in type: buffer

The following function properties of the math object: acos(), asin(), atan(), atan2(), cos(), exp(), log(), sin(), sqrt(), tan(), toExponential(), toFixed(), toPrecision().

Use of these unsupported features causes the VoiceXML interpreter to throw an error.semantic event. Cisco VoiceXML supports floating point operations with a limited number range:

MIN_VALUE = 5e-32

MAX_VALUE = 1.7976931348623157e+31

The size limit for JavaScript scripts is 65K in Cisco IOS Release 12.4(12), Cisco IOS Release 12.4(12)T, and later releases. Javascript scripts consume memory and CPU resources. To avoid performance problems, make sure JavaScript scripts contain only the minimum required code.

In document Cisco VoiceXML Programmer s Guide (Page 66-69)