Page 1 of 1
Dynamic grammars
Posted: Fri Mar 31, 2017 3:36 pm
by clydewallace
Hi,
I want to be able to include dynamic grammas from my own rest api of a list of names to match, etc.
How do I integrate the grammars into the Fuse+ modules?
THanks!
Re: Dynamic grammars
Posted: Mon Apr 03, 2017 2:31 pm
by support
You should use the subdialog module. Your subdialog would look something like this:
Code: Select all
<?php
// Call your REST API to get a list of names to match here
echo '<?xml version="1.0"?>';
?>
<vxml version="2.0">
<form>
<field name="providername">
<grammar type="application/srgs+xml" root="ROOT" mode="voice">
<rule id="ROOT">
<one-of>
<item>Mister Ahmed<tag>providername="Fawad Ahmed"</tag></item>
<item>Doctor Ahmed<tag>providername="Fawad Ahmed"</tag></item>
<!-- Format the list of names from your REST API to match VXML grammar here -->
</one-of>
</rule>
</grammar>
<prompt> Please say your provider's name. </prompt>
<filled>
<return namelist="providername"/>
</filled>
</field>
</form>
</vxml>
And your app should look like this:
https://drive.google.com/file/d/0B2RqW1 ... sp=sharing
You would reference the user's inputted name with the subdialog module name, and returned namelist. In this instance, it would be dynamic_name_grammar.providername.
Please let us know if you have questions.