Larson Technical Services: Voice Technology Consulting

Exercise 7.4

Many callers are reluctant to speak to a computer. Write a VoiceXML form field that solicits the caller’s name. Include five noresponse error handlers that encourage the caller to speak his or her name.


<?xml version="1.0"?>
<vxml version="2.0">

<!-- Exercise 7.4  -->

<form>
<field name="UserName">
     <prompt>Say your name</prompt>
          <catch event="noinput" count= "1">
               <prompt>
                    Sorry, I did not hear you, please say your name
               </prompt>
          </catch>
          <catch event="noinput" count= "2">
               <prompt>
                    I need your name to access your file, please say your name
               </prompt>
          </catch>
          <catch event="noinput" count= "3">
               <prompt>
                    Even though I am a computer program, I can understand 
                    you when you speak.  please say your name.
               </prompt>
          </catch>
          <catch event="noinput" count= "4">
               <prompt>
                    It is really important that you speak your name now.
               </prompt>
          </catch>
          <catch event="noinput" count= "5">
               <prompt>
                    My name is Computer Application number 413, but 
                    everyone calls me Joan.  What is your name?
               </prompt>
          </catch>
          <catch event="noinput" count= "6">  
               <prompt>
                    Goodbye
               </prompt>
          <exit/>
          </catch>

     <grammar type="application/grammar+xml" version="1.0">
          <rule id = "aUser" scope = "public">
               <one-of>
                    <item>fred</item>
                    <item>sam</item>
               </one-of>
          </rule>
     </grammar>
</field>
</form> 
</vxml>

Return to the Instructor’s Page

Comments are off for this post