We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Dynamic grammars

Questions and answers about Plum Fuse+

Moderators: admin, support

Post Reply
clydewallace
Posts: 2
Joined: Fri Mar 31, 2017 3:21 pm

Dynamic grammars

Post 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!

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: Dynamic grammars

Post 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.

Post Reply