We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics
accept month by saying month name or pressing number
accept month by saying month name or pressing number
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?
Re: accept month by saying month name or pressing number
Hi,
Yes, it is possible to have srgs+xml allow either voice or dtmf input. This can be done by defining both the voice and dtmf grammar input for the desired field.
Here is an example using two values. You can capture either the dtmf input or voice input by using conditionals within the <filled> tag, as displayed in the code. In this snippet, entering 1 or saying january will match the same conditional.
Let us know if you have any further questions concerning this topic.
Best Regards,
Plum Support
Yes, it is possible to have srgs+xml allow either voice or dtmf input. This can be done by defining both the voice and dtmf grammar input for the desired field.
Here is an example using two values. You can capture either the dtmf input or voice input by using conditionals within the <filled> tag, as displayed in the code. In this snippet, entering 1 or saying january will match the same conditional.
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>
Best Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com