dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: [vxml]Field Type Question

  1. #1
    Join Date
    Aug 2009
    Posts
    1

    Question [vxml]Field Type Question

    I want to receive only * or # as legal input from user

    Can I use field elememt like this (change the termchar)

    ...
    <field name="demo" type="boolean?y=#;n=*">
    ...
    ...
    </field>

  2. #2
    Join Date
    Jan 2010
    Posts
    3

    Re: [vxml]Field Type Question

    Hmm. I've never seen the boolean type used that way. There may be an platform-specific extension out there somewhere like that, but all I've ever seen is

    type="boolean"

    I think what you need is to create your own very simple grammar, like in the following form:

    <form id="push_something">
    <field name="demo">
    <grammar type="application/x-jsgf" mode="dtmf"> "#" | "*" </grammar>
    <prompt>Please press the pound or star key.</prompt>
    </field>
    </form>
    </vxml>

    Instead of using the built-in boolean grammar, that form specifies a simple grammar that only accepts "#" or "*".

    If you want to map "#" to "y" and "*" to "n" in the "demo" var, you could extend that grammar in the following way:

    <grammar type="application/x-jsgf" mode="dtmf"> "#" {y} | "*" {n} </grammar>

    There are some nice, simple examples of JSGF grammars on the docs for the PlumVoice platform:

    http://www.plumvoice.com/docs/hosting/

    Another common grammar type used in IVR is SRGS+XML. See same docs.

    Good luck!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)