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

Unexpected results when Grammar tag is being used

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

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

mix of builtin and inline IVR grammars not recommended

Post by support »

Hi,

The reason for this behavior with your IVR code is because you are using a mix of builtin IVR (<field name="phone" type="digits?length=10">) and inline IVR (<grammar mode="dtmf" type="application/x-jsgf">(1|2|3|4|5|6|7|8|9|0)+ </grammar>) <grammar>s.

Instead, you should rearrange your IVR code to the following:

builtindigitsdtmfgrammar.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">

<form id="phone">
<field name="phone">
<grammar src="builtin:dtmf/digits?length=10"/> 
<prompt bargein="false">
Your phone number is needed for future verification purposes. Using the keypad
on your telephone, please enter your 10-digit telephone number, starting with the area code.
</prompt>
<filled>
<assign expr="phone" name="phoneNum"></assign>
</filled>
</field>
</form> 

</vxml>
Hope this helps.

Regards,
Plum Support

Post Reply