I would like, that if the user says “help” that the following field doesn’t get filled, and that the user gets all possible options.
<form id="test">
<field name="var1">
<prompt bargein="true" bargeintype="hotword" >say xy </prompt>
<grammar src = "grammar.grxml" type="application/srgs+xml" />
<filled>
<assign name="myProdukt" expr="var1" />
you said <value expr="myProdukt"/>
</filled>
</field>
(let’s say in the external grammar is “p1”, “p2” and “p3”, the user says “help”, and the systems says “p1″,”p2″,”p3” and the user can choose again – therefore the word “help” has to be in the external grammar as well, doesn’t it?)
thanks in advance
Yes, the active grammar must contain a “help” utterance which returns the value ‘help’. You then catch the event with a
helptag:Alternatively, following the DRY principle, this effect can be done globally for your application with using an application root document containing a
linkelement. In the exampleapp-root.vxmldocument below, there is alinkbinding a global grammar “help” utterance to thehelpevent :This grammar will be active everywhere — effectively merged with each active field grammar. If you need more information about application root documents, the section of the VoiceXML specification Executing a Multi-Document Application explains. Also see Handling Events from the Tellme Studio documentation
Then, in pages of your application, make reference to the application root document via the
applicationattribute of thevxmlelement and speak appropriately in ahelpcatch block:You could, of course, put the
linkcode in the same page as your form, but it is likely you will wanthelpactive for every field of your application unless there is collision with something in a particular field’s grammar.