accept month by saying month name or pressing number
Posted: Tue Sep 03, 2013 1:14 pm
Is it possible to have srgs+xml configured to allow a user to either say the month or corresponding number? EG: say "august' or accept button press 8?
Welcome to the PlumVoice IVR Support Forum
https://support.plumvoice.com/
Code: Select all
<form>
<field name="month">
<grammar type="application/srgs+xml" root="NUMBERS" mode="dtmf">
<rule id="NUMBERS">
<one-of>
<item>1</item>
<item>2</item>
</one-of>
</rule>
</grammar>
<grammar type="application/srgs+xml" root="UTTERANCE" mode="voice">
<rule id="UTTERANCE">
<one-of>
<item>january</item>
<item>february</item>
</one-of>
</rule>
</grammar>
<prompt>
Either say or enter a month
</prompt>
<filled>
<if cond="month==1 || month=='january'">
<!-- here you can handle input for january/1 -->
You entered <value expr="month"/>
<elseif cond="month==2 || month=='february'"/>
<!-- here you can handle input for february/2 -->
You entered <value expr="month"/>
</if>
</filled>
<nomatch>
You did not say a month.
<reprompt/>
</nomatch>
<noinput>
You did not enter anything.
<reprompt/>
</noinput>
</field>
</form>