Code: Select all
<grammar type="application/srgs+xml" root="goback" mode="dtmf" version = "1.0">
<rule id="goback" scope="public">
<one-of>
<item>*</item>
</one-of>
</rule>
</grammar>
Any ideas?
Thanks!
Code: Select all
<grammar type="application/srgs+xml" root="goback" mode="dtmf" version = "1.0">
<rule id="goback" scope="public">
<one-of>
<item>*</item>
</one-of>
</rule>
</grammar>
Code: Select all
<?xml version="1.0"?>
<vxml version="2.0">
<form id="mainmenu">
<block>
<prompt>
Welcome to the main menu!
</prompt>
<goto next="#starfield"/>
</block>
</form>
<form id="starfield">
<field name="key">
<grammar type="application/srgs+xml" root="goback" mode="dtmf" version = "1.0">
<rule id="goback" scope="public">
<one-of>
<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>0</item>
<item>"#"</item>
<item>"*"</item>
</one-of>
</rule>
</grammar>
<prompt>
Please enter a key.
</prompt>
<filled>
<prompt>
You entered <value expr="key"/>.
</prompt>
<if cond="key=='*'">
<goto next="#mainmenu"/>
<else/>
<prompt>
Goodbye!
</prompt>
</if>
</filled>
</field>
</form>
</vxml>
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<form id="mainmenu">
<block>
<prompt>
Welcome to the main menu!
</prompt>
<goto next="#starfield"/>
</block>
</form>
<form id="starfield">
<field name="input">
<grammar root="ROOT" type="application/srgs+xml" mode="dtmf">
<rule id="ROOT" scope="public">
<one-of>
<item repeat="0-255">
<ruleref uri="#digit"/>
</item>
<item> "* #" </item>
<item> "#" </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>
<item> "#" </item>
</one-of>
</rule>
</grammar>
<prompt>
Please enter some digits.
</prompt>
<filled>
<assign name="input" expr="input.replace(/ /g, '')"/>
<if cond="input == '*'">
<goto next="#mainmenu"/>
<elseif cond="input.length == 6"/>
<prompt>
You entered <say-as type="acronym"><value expr="input"/></say-as>. Thank you for entering exactly 6 digits.
</prompt>
<else/>
<prompt>
You entered <say-as type="acronym"><value expr="input"/></say-as>. You have entered an incorrect amount of digits.
</prompt>
<clear namelist="input"/>
</if>
</filled>
</field>
</form>
</vxml>