Re: Validating variable against list
Posted: Wed May 05, 2010 11:33 am
Hi,
It tends to be difficult to deal with alphanumeric grammars within IVR applications. To get around this limitation we had split up the grammars. This code assumes that the last 2 numbers within the jcode were actual digits. There is one issue with separating the grammars in this fashion. The grammars require a pause between entering the first portion of the input and the second. To make sure the users correctly input the jcode, you may want to prompt them to enter the first portion followed by a pause and then the second portion.
Hope this help!
Regards,
Plum Support
It tends to be difficult to deal with alphanumeric grammars within IVR applications. To get around this limitation we had split up the grammars. This code assumes that the last 2 numbers within the jcode were actual digits. There is one issue with separating the grammars in this fashion. The grammars require a pause between entering the first portion of the input and the second. To make sure the users correctly input the jcode, you may want to prompt them to enter the first portion followed by a pause and then the second portion.
Code: Select all
<?xml version="1.0"?>
<vxml version="2.0">
<form id="jcode">
<property name="interdigittimeout" value="5s"/>
<field name="myvar1">
<grammar type="application/srgs+xml" root="start_voice" mode="voice">
<rule id="start_voice">
<one-of>
<item> 920 </item>
<item> 992 </item>
<item> S06 </item>
<item> J12 </item>
</one-of>
</rule>
</grammar>
<prompt bargein="true">
<audio src="http://audio.plumgroup.com/root/cvc4.wav">
Please speak or key in the J-CODE for the service provided.
</audio>
</prompt>
</field>
<field name="myvar2" type="digits?length=2">
<prompt/>
<filled>
<script>
total = myvar1 + myvar2
</script>
<assign name="jcode" expr="total"/>
</filled>
<noinput>
<prompt bargein="false">
<audio src="http://audio.plumgroup.com/root/999999_163.wav">
I'm sorry, but I did not get your response.
</audio>
</prompt>
<reprompt/>
</noinput>
</field>
</form>
</vxml>
Regards,
Plum Support