I'm trying to specified a grammar rule to start recognition. i.e
<grammar src="NextActionGrammar.grxml#three" type="application/srgs+xml" mode ="dtmf" maxage="0"/>
This rule(three) never becomes active, the rule that is always execute in the grammar file is always root..
Is this the proper way to activate this rule from the grammar file?? Please help..THANKS
We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics
Specify Grammar rule to execute
Re: Specify Grammar rule to execute
Hi,
Thanks for bringing this issue to our attention. We have added this matter to our internal platform update page to be addressed for future releases of our platform.
As an interim solution, you can setup your code in the following way:
remotegrammartest.php:
testgrammar.grxml:
From this example, please note that in the <ruleref> of the local grammar, you will need to use a full URL to reference your external grammar in that way. From this implementation, you will be able to override the root attribute in your external grammar with what you have set within your local grammar.
Hope this helps.
Regards,
Plum Support
Thanks for bringing this issue to our attention. We have added this matter to our internal platform update page to be addressed for future releases of our platform.
As an interim solution, you can setup your code in the following way:
remotegrammartest.php:
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<form id="main">
<field name="something">
<grammar type="application/srgs+xml" root="test" maxage="0">
<rule id="test" scope="public">
<ruleref uri="http://www.myserver.com/testgrammar.grxml#three"/>
</rule>
</grammar>
<prompt>
Please say an animal.
</prompt>
<filled>
<prompt>
The animal you have picked is <value expr="something"/>.
</prompt>
</filled>
</field>
</form>
</vxml>
Code: Select all
<?xml version="1.0"?>
<grammar type="application/srgs+xml" version="1.0" xml:lang="en-US" root="two" mode="voice">
<rule id="one" scope="public">
<one-of>
<item>cat</item>
<item>dog</item>
</one-of>
</rule>
<rule id="two" scope="public">
<one-of>
<item>frog</item>
<item>turtle</item>
</one-of>
</rule>
<rule id="three" scope="public">
<one-of>
<item>chicken</item>
<item>horse</item>
</one-of>
</rule>
</grammar>
Hope this helps.
Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com
Re: Specify Grammar rule to execute
The interim solution mention below will not work for me since our grammar rule comes in from a variable. This variable can not be passed into grxml.
Is there a time line on when this issue will be resolved in your platform? Can you offer any other suggestion
This is how I would normally call a rule inside my grammar file
Is there a time line on when this issue will be resolved in your platform? Can you offer any other suggestion
This is how I would normally call a rule inside my grammar file
Code: Select all
<form id="ChooseNextMenu">
<block>
<assign name="CurrentPage" expr="VxmlPage" />
<assign name="CurrentForm" expr="'ChooseNextMenu'" />
<assign name="ruleid" expr="MenuEcma.GrammarNeeded.toString()" />
<log expr="'Presenting next menu options.'" />
<assign name="SpeedAddressSpeech" expr="speakNumberDigits(MenuEcma.SpeedAddress)" />
</block>
<field name="MenuNextAction">
<property name="termchar" value="A" />
<grammar srcexpr="'NextActionGrammar.grxml#' + ruleid" />
Re: Specify Grammar rule to execute
Hi,
Yes, based on your implementation, the interim solution that suggested in the previous post will not work.
This issue has been marked within our internal platform update page to be addressed in a future platform release. However, there is no guaranteed timeline on when this release will come out.
As a workaround, instead of directing your code to go to a specific location in your grammar file, you could perhaps create multiple grammar files for your application to use based on what gets returned for your variable.
Please let us know if you need any assistance on how you would use multiple grammar files within your code.
Regards,
Plum Support
Yes, based on your implementation, the interim solution that suggested in the previous post will not work.
This issue has been marked within our internal platform update page to be addressed in a future platform release. However, there is no guaranteed timeline on when this release will come out.
As a workaround, instead of directing your code to go to a specific location in your grammar file, you could perhaps create multiple grammar files for your application to use based on what gets returned for your variable.
Please let us know if you need any assistance on how you would use multiple grammar files within your code.
Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com
Re: Specify Grammar rule to execute
OK.. Can you tell me if this is possible using your own example below.
I want the grammar to return a number on these matches for example
I can't seem to get anything other than the <item> using this method
Code: Select all
rule id="one" scope="public">
<one-of>
<item>cat</item>
<item>dog</item>
</one-of>
</rule>
Code: Select all
rule id="one" scope="public">
<one-of>
<item>cat<tag>Rating="1"</tag></item>
<item>dog<tag>Rating="2"</tag></item>
</one-of>
</rule>
Re: Specify Grammar rule to execute
Hi,
You will need to reference the 'Rating' for the field item. Here's a brief script which details this:If you say cat, your should hear 'You entered: 1'.
Hope this helps!
Regards,
Plum Support
You will need to reference the 'Rating' for the field item. Here's a brief script which details this:
Code: Select all
<?php
header("Content-type: text/xml");
echo "<?xml version=\"1.0\"?>"
?>
<vxml version="2.0">
<form>
<field name="input">
<prompt> Say either cat or dog. </prompt>
<grammar type="application/srgs+xml" root="one" mode="voice">
<rule id="one" scope="public">
<one-of>
<item> cat <tag> Rating="1" </tag> </item>
<item> dog <tag> Rating="2" </tag> </item>
</one-of>
</rule>
</grammar>
<filled>
<prompt> You entered: <value expr="input.Rating"/> </prompt>
</filled>
</field>
</form>
</vxml>
Hope this helps!
Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com