Benutzerdefinierte Suche

How to Use VoiceXML time measurement per JavaScript

Summary:

Time measurements using JavaScript to maturity in Voice browsers are technically possible. You are using the JavaScript object date.
If a VoiceXML file is running then you see the timestamp has low interval. The FIA algorithm uses the modus prefetch.
A server side solution per JPS and Servlets solves not the issue. It is has the same effect likes the client side. At the moment is none workaround known to solve the

issue. I use the tools IBM WebSphere Voice Toolkit V6.0 and the Rational Application Developer 6.0.

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE vxml PUBLIC "-//W3C//DTD VOICEXML 2.1//EN" "http://www.w3.org/TR/voicexml21/vxml.dtd">
<vxml xmlns="http://www.w3.org/2001/vxml" version="2.1"    xml:lang="de-DE">

    <script fetchhint="safe"> <![CDATA[
        function getTime(now){
            return now.getTime();
        }
    ]]> </script>

    <var name="myEvent" expr="false"/>
   
    <form id="Start">
        <block name="Block1">
            <log label="logBlock1" expr="getTime(new Date());"> User entered Block1!</log>
            <log>1: <value expr="myEvent"/></log>
            <prompt>
                Hello please wait a moment. Thanks.
            </prompt>
            <assign name="myEvent" expr="true"/>       
        </block>

        <block name="Block2">
            <if cond="myEvent==true">
                 <log label="logBlock2" expr="getTime(new Date());"> User entered Block2!</log>
                <throw eventexpr="myEvent" messageexpr="'An event occrs!'"/>
            </if>
        </block>

        <catch cond="myEvent">
            <log>2: <value expr="myEvent"/></log>
            <goto fetchhint="safe" next="#End"/>
        </catch>
    </form>

    <form id="End">
        <block name="Block3">
            <if cond="myEvent==true">
                <log label="logBlock3" expr="getTime(new Date());"> User entered Block3!</log>
                <prompt>
                    The system terminate the call.
                </prompt>
                <exit/>
            </if>
        </block>
    </form>
</vxml>

0 Kommentare: