Hi
How can i take "*" as an user input. All the other inputs were working fine but when i enter "*" or any combination with "*" Ex. "*45" ,"45*4" etc. it says i could not understand.
Can you please help me on this.
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 take "*" as user input
Re: How to take "*" as user input
Hi kapil,
Below is some sample code that demonstrates how to take '*' as user input:
Hope this helps.
Regards,
Plum Support
Below is some sample code that demonstrates how to take '*' as user input:
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<form id="mainmenu">
<field name="myfield">
<grammar root="ROOT" type="application/srgs+xml" mode="dtmf">
<rule id="ROOT" scope="public">
<one-of>
<item repeat="0-255">
<ruleref uri="#digit"/>
</item>
</one-of>
</rule>
<rule id="digit" scope="public">
<one-of>
<item> 0 </item>
<item> 1 </item>
<item> 2 </item>
<item> 3 </item>
<item> 4 </item>
<item> 5 </item>
<item> 6 </item>
<item> 7 </item>
<item> 8 </item>
<item> 9 </item>
<item> * </item>
</one-of>
</rule>
</grammar>
<prompt>
Enter some digits.
</prompt>
<filled>
<if cond="myfield.indexOf('*') != -1">
<assign name="myfield" expr="myfield.replace('*', 'star')"/>
<prompt>
You entered <value expr="myfield"/>.
</prompt>
<else/>
<prompt>
You entered <value expr="myfield"/>.
</prompt>
</if>
</filled>
</field>
</form>
</vxml>
Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com