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

Delay after taking user input.

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
aliasg
Posts: 24
Joined: Sat Mar 14, 2009 1:23 am

Delay after taking user input.

Post by aliasg »

I am facing a problem of delay, first of all what i want is to take five digits number input from the user and i provided interdigittimeout to 5 secs. SO when user enters all 5 digits programs waits for 5 seconds then prompts the entered number.

I do not want this 5 sec delay here so i added termmaxdigits to true but it also does not work. After some trying i came to know that if i remove the <grammer> tag then it works as expected. Where is the problem in the code? OR why grammar tag is causing problem with interdigittimeout?

Here is the code.

<?xml version="1.0"?>
<vxml version="2.0">
<property name="termmaxdigits" value="true"/>
<property name="interdigittimeout" value="5s"/>
<form>
<field name="myfield" type="digits?length=5">
<!-- Multiple grammars can be specified either by including -->
<!-- several grammar blocks within the field item or by -->
<!-- specifying a built-in grammar with the "field" tag's -->
<!-- "type" attribute. -->
<grammar type="application/x-jsgf" mode="dtmf">
1 | 2
</grammar>
<grammar type="application/x-jsgf" mode="voice">
one | two
</grammar>
<prompt>
Say or enter any number of length 5.
</prompt>
<filled>
You entered <value expr="myfield"/>.
</filled>
<nomatch>
You did not say or enter any ones or twos.
<reprompt/>
</nomatch>
<noinput>
You did not enter anything.
<reprompt/>
</noinput>
</field>
</form>
</vxml>
Ali

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

clarification of IVR application

Post by support »

Hi,

There are a few things we want to clarify for your IVR application before we can come up with a solution for your IVR code example.

Are you looking to collect only a five digit entry of ones or twos (meaning the user can only enter 5 digits of strictly 1s or 2s)? Or are you looking to collect a five digit entry or a 1 or 2 from the user (meaning the user can only enter 5 digits or a 1 or a 2 for his input)?

Regards,
Plum Support
Last edited by support on Tue Feb 16, 2010 12:56 pm, edited 2 times in total.

aliasg
Posts: 24
Joined: Sat Mar 14, 2009 1:23 am

Post by aliasg »

Hi,


Thanks for the reply. Just make it this way, I just want to collect choices from user which could be 1 or 2. So "Say or enter any number of length 5. " will become "Enter 1 or 2." and "digits?length=5" becomes "digits?length=1".

Same way if you collect 20 or 30 and make ?length=2 it will again wait for 5 seconds.
Ali

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

IVR example that uses termmaxdigits

Post by support »

Hi,

You can use the following IVR code example using the IVR property, termmaxdigits, to help you achieve this:

termmaxdigitsnodelay.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<property name="termmaxdigits" value="true"/>
<property name="interdigittimeout" value="30s"/>
<form>
<field name="myfield">
<!-- Multiple grammars can be specified either by including -->
<!-- several grammar blocks within the field item or by -->
<!-- specifying a built-in grammar with the "field" tag's -->
<!-- "type" attribute. -->
<grammar type="application/x-jsgf" mode="dtmf" maxdigits="1"> 
^(1 | 2)$ 
</grammar> 
<grammar type="application/x-jsgf" mode="voice" maxdigits="1">
one | two
</grammar>
<prompt>
Enter 1 or 2.
</prompt>
<filled>
You entered <value expr="myfield"/>.
</filled>
<nomatch>
You did not say or enter any ones or twos.
<reprompt/>
</nomatch>
<noinput>
You did not enter anything.
<reprompt/>
</noinput>
</field>
</form>
</vxml>
Hope this IVR example helps.

Regards,
Plum Support

Post Reply