We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

why does my <option> tag throw an error.grammar.option

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
ipath
Posts: 7
Joined: Wed Apr 14, 2004 12:44 am

why does my <option> tag throw an error.grammar.option

Post by ipath »

I have defined the <option> for a field as

Code: Select all

  <option dtmf="1" value="pwsCntRef1074777064629_2">Pick a contact</option> 
  <option dtmf="2" value="pwsCntRef1066377085583_2">Track Messages</option> 
  <option dtmf="3" value="pwsCntRef1067942510592_2">Unread Messages</option> 
  <option dtmf="4" value="pwsCntRef1069752628663_2">Emails</option> 
  <option dtmf="5" value="pwsCntRef1070449195414_2">Urgent</option> 
  <option dtmf="6" value="pwsCntRef1063996707468_2">Contacts</option> 
  <option dtmf="8" value="LeaveMsgForMobile">Leave Message For Mobile</option> 
  <option dtmf="0" value="help">zero</option> 
  <option dtmf="9" value="options">options</option> 
  <option value="help">help</option> 
  <option value="help">o</option> 
  <option value="bye">bye</option> 
  <option value="bye">exit</option> 
  <option value="bye">quit</option> 
  <option value="back">back</option> 
  <option value="home">home</option> 
  <option value="options">options</option> 
  <option value="bye">#</option> 
  
When I executed I got the "A serious error of type ". I have placed the log msg here.
Is the
(options) {options} |
generated twice is creating the problem? I validated the vxml with no errors.

Thanks.

Log:

<?xml version='1.0'?>
<grammar type="application/jsgf" mode="voice">
(Pick a contact) {pwsCntRef1074777064629_2} |
(Track Messages) {pwsCntRef1066377085583_2} |
(Emails in Inbox) {pwsCntRef1067942510592_2} |
(Unread Messages) {pwsCntRef1069752628663_2} |
(Contacts) {pwsCntRef1063996707468_2} |
(Leave Message For Mobile) {LeaveMsgForMobile} |
(zero) {help} |
(options) {options} |
(help) {help} |
(o) {help} |
(bye) {bye} |
(exit) {bye} |
(quit) {bye} |
(back) {back} |
(home) {home} |
(options) {options} |
(#) {bye}
</grammar>

---------

Wed 02 Jun 2004 09:07:34 PM EDT (000000;000;1086224771) [prompt] EVENT: bargein set to true
Wed 02 Jun 2004 09:07:34 PM EDT (000000;000;1086224771) [prompt] EVENT: INPUTMODES set to "DTMF VOICE"
Wed 02 Jun 2004 09:07:34 PM EDT (000000;000;1086224771) [prompt] EVENT: Audio segment added to prompt queue from TTS text/plain;charset=wchar_t for:
---------

A serious error of type
---------
Wed 02 Jun 2004 09:07:34 PM EDT (000000;000;1086224771) [prompt] EVENT: bargein set to true
Wed 02 Jun 2004 09:07:34 PM EDT (000000;000;1086224771) [prompt] EVENT: INPUTMODES set to "DTMF VOICE"
Wed 02 Jun 2004 09:07:34 PM EDT (000000;000;1086224771) [prompt] EVENT: Audio segment added to prompt queue from TTS text/plain;charset=wchar_t for:
---------
error.grammar.option
---------

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR example for Option Tag Usage

Post by support »

This IVR error is being caused by your use of # as a dtmf option. When # (or *) are used in an <option> or a <choice> tag they must be escaped with quotes. Below is a simple IVR example of how to properly use a # in an option:

Code: Select all

<? xml version="1.0"?>
<vxml version="2.0">
  <form>
    <field name="field1">
      <option dtmf="1" value="pwsCntRef1074777064629_2">Pick a contact</option>
      <option dtmf="2" value="pwsCntRef1066377085583_2">Track Messages</option>
      <option dtmf="3" value="pwsCntRef1067942510592_2">Unread Messages</option>
      <option value="bye">"#"</option>
    </field>
  </form>
</vxml>
Hope this helps! :)

Plum Support
Last edited by support on Thu Feb 25, 2010 4:54 pm, edited 3 times in total.

ipath
Posts: 7
Joined: Wed Apr 14, 2004 12:44 am

Post by ipath »

Thanks for the reply.

Also,

Code: Select all

<option value="help">o</option> 
This above statement is also creating problem. I removed this statement from the application to make it work.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

typo in IVR code

Post by support »

I think you have a typo in your IVR code...

it should be the number '0', not the letter 'o'

as such:

Code: Select all

<option value="help">0</option>
Last edited by support on Fri Jan 15, 2010 4:40 pm, edited 1 time in total.

ipath
Posts: 7
Joined: Wed Apr 14, 2004 12:44 am

Post by ipath »

No, it is "o" only. Some people say "0" for zero. So, I included that option.

Thanks.

ipath
Posts: 7
Joined: Wed Apr 14, 2004 12:44 am

Post by ipath »

Sorry, some people say "oh" for zero.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

use of <option> tag in IVR code

Post by support »

I cant replicate the IVR error you are encountering. Try looking at the IVR example for <option> tag found in the vxml reference manual. I was able to modify it to support the functionality you described:

http://www.plumvoice.com/docs/dev/voicexml:tags:option

Hope this IVR source helps!

Plum Support
Last edited by support on Thu Feb 25, 2010 4:55 pm, edited 3 times in total.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

modification of IVR example

Post by support »

Hello iPath:

I have taken the liberty of modifying the IVR example in the url from the previous post. I think this does what you are talking about:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">
  <form>
    <field name="maincourse">
    <prompt>
      Please select an entree. Today, we're featuring:
      <enumerate/>
    </prompt>
    <option dtmf="1" value="fish"> swordfish </option>
    <option dtmf="2" value="beef"> roast beef </option>
    <option value="help"> o </option>
    <filled>
        You chose <value expr="maincourse"/>.
    </filled>
   </field>
</form>
</vxml>
in the above IVR example, saying "oh" will result in field being set to "help". I tested this on our IVR hosting environment and it seems to work fine.

Hope this helps!! :)

Sincerely,

Plum Support

Post Reply