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

How to calculate the number of events on two fields?

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
soso
Posts: 62
Joined: Tue Apr 22, 2008 8:11 am

How to calculate the number of events on two fields?

Post by soso »

Hi,

On my form, I've two fields:

Code: Select all

<field name="field1">
<filled>
...
</filled>
<noinput>
...</noinput>
<nomatch>
...
</nomatch>
</field>

<field name="field2">
<filled>
</filled>
<noinput>
...</noinput>
<nomatch>
...
</nomatch>
</field>
I would like to know if it's possible to know on the second field how much post time the "nomatch" or "noinput" event is counted?

Or, If the field1 was execute twice event noinput, I would like to the next event on the "field2" is "noinput count="3"" !

Is it possible and how?

Thanks by advance.

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

IVR example that counts noinput/nomatch events

Post by support »

Hi,

Here's an IVR example using the IVR tags, <noinput> and <nomatch>, that could help you implement this:

countnoinputnomatch.php:

Code: Select all

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

<var name="counter" expr="0"/>

<field name="bam1" type="digits?length=3">
<prompt>
Please enter some digits.
</prompt>

<filled>
<prompt>
You have entered <value expr="bam1"/>.
</prompt>
</filled>

<noinput>
<assign name="counter" expr="++counter"/>
<prompt>
You have not entered anything.
The nomatch noinput counter <value expr="counter"/>
</prompt>
</noinput>

<nomatch>
<assign name="counter" expr="++counter"/>
<prompt>
You entered the incorrect amount of digits.
The nomatch noinput counter is <value expr="counter"/>
</prompt>
</nomatch>

</field>

<field name="bam2" type="digits?length=3">
<prompt>
Please enter some digits.
</prompt>

<filled>
<prompt>
You have entered <value expr="bam2"/>.
</prompt>
</filled>

<noinput>
<assign name="counter" expr="++counter"/>
<prompt>
You have not entered anything.
The nomatch noinput counter is <value expr="counter"/>
</prompt>
</noinput>

<nomatch>
<assign name="counter" expr="++counter"/>
<prompt>
You entered the incorrect amount of digits.
The nomatch noinput counter is <value expr="counter"/>
</prompt>
</nomatch>
</field>

</form>
</vxml>
Hope this IVR code helps.

Regards,
Plum Support

Post Reply