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

Builtin digit grammar plus "#"

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
labbruzzesi
Posts: 7
Joined: Fri Feb 18, 2005 8:09 am
Contact:

Builtin digit grammar plus "#"

Post by labbruzzesi »

Hello Plum Team,

I have been trying to use the builtin digit grammar for a field. I would like the user to terminate input with '#' which works fine by default. But I also would like to accept only '#' (which is used to back up to a previous dialog).

'#' and '*' are the only keys that throw a nomatch in the builtin digits grammar.

I tried this first:

<field name="newPassword" type="digits"> (no specific length)
<grammar>"#"</grammar>

but when a digits were terminated with '#', all that was in the field was the '#'.

I am now doing the following :

<field name="newPassword" type="digits"> (no specific length)
<grammar>"*"</grammar>

The only thing that can throw a nomatch is now the '#'.......... this method allows terminating digits with '#' and entering '#' by itself. When there is a nomatch, I know that '#' was entered by itself.

Is there a more elegant way to accomplish this?

Thank you

Lou Abbruzzesi

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

IVR platform matches # whenever it's pressed

Post by support »

Hello,

The problem you are running into is that JSGF grammars (the default for Plum IVR systems) are inclusive by default. This means that when you specify an IVR grammar containing only "#" you will have match not only # but also 1234# etc. Also, the Plum IVR system will match grammars in reverse order of appearance when they are in the same scope. These two things cause the IVR platform to match # whenever it is pressed. The most elegant way to correct this is to specify to the grammar engine that you wish to match # only when it is pressed by itself. The IVR grammar for this case is:

Code: Select all

<grammar>^"#"$</grammar>

This will force the platform to only match # if it was the only key pressed.

Hope This Helps!

Plum Support

Post Reply