Page 1 of 1

How to calculate the number of events on two fields?

Posted: Thu Sep 17, 2009 4:20 am
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.

IVR example that counts noinput/nomatch events

Posted: Thu Sep 17, 2009 10:06 am
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