developer.com
Search EarthWeb
CodeGuru | Gamelan | Jars | Wireless | Discussions
Navigate developer.com
Architecture & Design  
Database  
Java
Languages & Tools
Microsoft & .NET
Open Source  
Project Management  
Security  
Techniques  
Voice  
Web Services  
Wireless/Mobile
XML  
New
 
Technology Jobs  

   Developer.com Webcasts:
  The Impact of Coding Standards and Code Reviews

  Project Management for the Developer

  Defining Your Own Software Development Methodology

  more Webcasts...




See the Winners!




Developer Jobs

Be a Commerce Partner














 


 Whitepaper: Integrating Telephony Services into .NET Applications
Sponsored by Avaya
Learn how developers using Microsoft's .NET framework can use SIP Objects.NET to gain simple and flexible access to telephony networks. SIP Objects.NET enables developers to access a wide variety of enterprise or traditional carrier networks by leveraging technologies such as Avaya's SIP Application Server. »
 
  Whitepaper: SIP—Creating Next-Generation Telecom Applications
Sponsored by Avaya
Developing applications to run on a telecommunications network has never been easier with Internet-based standards such as the Session Initiation Protocol (SIP). Combined with the power and simplicity of Java technology in the form of the SIP Servlet API, an application developer can create and deploy new services to users in a fraction of the time it previously took. »
 
 Whitepaper: Event Driven Architectures in the Responsive Enterprise
Sponsored by Avaya
This whitepaper introduces the concept of Event Driven Architecture (EDA) and describes the key role it plays in enabling new business strategies for Communications Enabled Business Processes. Learn more. Download this whitepaper.»
 
 Whitepaper: Developing Contact Center Telecom Applications
Sponsored by Avaya
SIP servlets make developing applications for telecommunications networks easier than ever before. Learn just how easy it is to create a basic telecommunications application using SIP servlets. The use of open standards such as SIP, together with Java programming, has radically simplified the task of creating complex applications. »
 
Developer News -
USB 3.0 One Step Closer to Reality    August 14, 2008
Would-Be Linux Contributors May Get a Leg Up    August 13, 2008
SAP, Oracle Holding Out on Ubuntu?    August 12, 2008
GIPS Technology to Voice-Enable iPhone Apps    August 12, 2008
Free Tech Newsletter -

Join the Palm Developer Network and Build Your Business with Palm. Get technical, marketing & sales services designed to help you move rapidly from concept to market with reduced cost and complexity.

Tellme More
By Jonathan Eisenzopf

Go to page: Prev  1  2  3  4  5  6  7  Next  

Handling Events
Invalid Input

Handling forms requires more than simply gathering field input. If the user provides input that doesn't match the grammar, Tellme will look for the nomatch element. If it doesn't exist, the application will croak. The most common way to handle invalid input is to tell the user so and ask them for the information again.

<?xml version="1.0"?>
<vxml version="1.0" >
<form id="hello">
<field name="pin">
<grammar>
<![CDATA[
Four_digits
]]>
</grammar>
<prompt>Please enter your 4 digit pin code.</prompt>
<filled>
<submit next="http://www.webreference.com/cgi-bin/perl/20/pin.pl"/>
</filled>
<nomatch>Invalid pin code.
<reprompt/>
</nomatch>
</field>
</form>
</vxml>

In the example above, we are using one of the Tellme grammars, Four_digits, to regulate the input. The grammar contains rules that will cause the document to call the nomatch event unless the user enters four numbers via the phone keypad or by voice. The reprompt element repeats the last prompt, Please enter your 4 digit pin code after telling the user that they've entered an invalid PIN code. Tellme will keep reprompting the user as long as they keep entering invalid input.

Of course, if the user is repeatedly entering invalid input, giving them the same error message and prompt won't help the user any. In fact, it would be downright user unfriendly. This is why the nomatch element includes a count attribute that allows us to give the user a different warning message each time the nomatch event is called.

<nomatch count="1">Invalid pin code.
<reprompt/>
</nomatch>
<nomatch count="2">Please press or say exactly four numbers.
<reprompt/>
</nomatch>
<nomatch count="3">Too many attempts. Please call back another time. <exit/>
</nomatch>

Now, the second time the user provides bad input, we give them more specific instructions, "Too many attempts. lease call back another time." The third time the user provides bad input, we exit the program.

No Input

Like handling invalid input, it's also critical to handle no input. Tellme calls the noinput event when the user does not provide any input after a prompt has been played.

<?xml version="1.0"?>
<vxml version="1.0" >
<form id="hello">
<field name="pin">
<grammar>
<![CDATA[
Four_digits
]]>
</grammar>
<prompt>Please enter your 4 digit pin code.</prompt>
<filled>
<submit next="http://www.webreference.com/cgi-bin/perl/20/pin.pl"/>
</filled>
<noinput>
<reprompt/>
</noinput>
<nomatch>Invalid pin code.
<reprompt/>
</nomatch>
</field>
</form>
</vxml>

Like the nomatch element, if you don't handle the noinput event, your VoiceXML application will return an error when it's called. Also, like nomatch, you can set the count attribute so that a different message is played each time the user fails to provide input.

<noinput count="1">No PIN entered.
<reprompt/>
</noinput>
<noinput count="2">You must enter your PIN number to proceed.
<reprompt/>
</noinput>
<noinput count="3">Please press or say exactly four numbers.
</noinput>

If the noinput event is called more than 3 times, Tellme will continue to repeat the last noinput, "Please press or say exactly four numbers.", until the user provides some input.

Go to page: Prev  1  2  3  4  5  6  7  Next  


Tools:
Add www.developer.com to your favorites
Add www.developer.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed


Voice Archives

Blog: Windows Server 2008. Keep up with the latest tricks, tips, and news.
Guide to Developing a Web Site. Best Practices, Tips and Strategies. Download Exclusive eBook Now.
Generate Complete .NET Web Apps in Minutes . Download Iron Speed Designer today.
Best Practices for Developing a Web Site. Checklists, Tips & Strategies. Download Exclusive eBook Now.
Improve How You Manage Information: Becoming a Better Project Manager. Exclusive eBook - Download Now.



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers