| VoiceXML 2.1 Development Guide | Home | Frameset Home |
|
<field> element. These grammars will accept either voice or DTMF input from the user. Note that you will not need to further specify an external or inline grammar when using the field types:...
<field name="F_1" type="digits">
...
<filled>
<prompt>
Your input was <value expr="F_1"/>.
</prompt>
</filled>
</field>
...<field name="MyField" type="digits?minlength=3"><field name="MyField" type="digits?maxlength=3"><field name="MyField" type="digits?length=3"><field name="field_getdigits" type="digits?minlength=3;maxlength=9">
<?xml version="1.0"?>
<vxml version="2.1">
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>
<meta name="author" content="Dustin Hayre"/>
<meta name="copyright" content="2010 Voxeo Corporation"/>
<form>
<field name="F_1">
<grammar src="builtin:grammar/boolean"/>
<grammar src="builtin:dtmf/boolean"/>
<prompt> Here you can say yes, no, true or false, or press 1 for true and 2 for false </prompt>
<filled>
<!-- the interpretation will always be TRUE or FALSE -->
<log expr="'**** BOOLEAN: ' + lastresult$.interpretation"/>
</filled>
</field>
<field name="F_2">
<grammar src="builtin:grammar/digits"/>
<grammar src="builtin:dtmf/digits"/>
<prompt> Here you can input up to 16 digits, either by voice or DTMF - example: one, two, three, four </prompt>
<filled>
<log expr="'**** DIGITS: ' + lastresult$.interpretation"/>
</filled>
</field>
<field name="F_3">
<grammar src="builtin:grammar/number"/>
<grammar src="builtin:dtmf/number"/>
<prompt> Here you can input a number by voice or DTMF - examples: one hundred fifty, one thousand two hundred.</prompt>
<filled>
<log expr="'**** NUMBER: ' + lastresult$.interpretation"/>
</filled>
</field>
<field name="F_4">
<grammar src="builtin:grammar/currency"/>
<grammar src="builtin:dtmf/currency"/>
<prompt> Here you can input major currency such as Dollars, Pounds or Euros - examples: fifteen dollars and fifty cents, twenty euros.</prompt>
<filled>
<log expr="'**** CURRENCY: ' + lastresult$.interpretation"/>
</filled>
</field>
<field name="F_5">
<grammar src="builtin:grammar/time"/>
<grammar src="builtin:dtmf/time"/>
<prompt> Here you can enter the hour and minute by voice or DTMF - examples: half past two, twelve thirty. </prompt>
<filled>
<log expr="'**** TIME: ' + lastresult$.interpretation"/>
</filled>
</field>
<field name="F_6">
<grammar src="builtin:grammar/date"/>
<grammar src="builtin:dtmf/date"/>
<prompt> Here you can enter the date by voice or DTMF - example: august 20th. </prompt>
<filled>
<log expr="'**** DATE: ' + lastresult$.interpretation"/>
</filled>
</field>
</form>
</vxml>
| ANNOTATIONS: EXISTING POSTS |
safarishane
|
|
| Instead of using this notation:
<grammar src="builtin:grammar/date"/> I regularly use this type of syntax for calling the builtin grammars: <ruleref uri="builtin:grammar/digits"/> Inside the grammar itself. But on this platform, I see the following in my apache logs: 127.0.0.1 - - [20/Mar/2009:09:55:14 -0700] "GET /grxml/en-US/builtin:grammar/digits HTTP/1.1" 404 316 Is it not possible to call a builtin via ruleref on this platform? |
|
voxeoJason
|
|
| Hi,
Please stand by as we gather our resources and prepare an answer. In the meantime if you have any other questions, please don't hesitate to ask. Regards, Jason Voxeo Support |
|
voxeoblehn
|
|
| Hello,
The issue with using the <ruleref> element in this manner lies within the attribute specification of the uri. The uri attribute specifies the URI of the external grammar that is to be referenced. So by specifying "builtin:" we will look locally for a builtin grammar as you can see from your logs "/grxml/en-US/builtin:grammar/digits" The only way to reference inline built-in grammars would be via the <grammar> tag which you originally specified as such: [code] <grammar src="builtin:grammar/date"/> [/code] In essence, using the <ruleref> tag for specifying a builtin grammar are almost contradicting as the element is meant to look for an external grammar. Hope this helps. Best Regards, Brian Lehnen Voxeo Support |
|
safarishane
|
|
| Hi Brian,
I disagree that it's contradicting... because it is a valid URI I'm specifying, just not one you are looking for. (URI's dont require http or https) Not to mention your example, is really *kinda the same thing* is it not? Regardless, it's a limitation when porting grammars to the non-OSR engine you are using. OSR fully supports that notation for calling builtin's, primarily because there is a need to be able to call them *inside* a srgs compliant grammar, not just in the vxml code via type attribute or grammar tag. If I want to have a <one-of> list, where one of the options would call a builtin, I would need to do this. While in theory I could call multiple grammars from vxml, that prevents any advanced weighting schemes from being employed, etc. This would be a very nice thing to support in Prophesy. |
|
mikethompson
|
|
| Hi Shane,
I spoke with a couple of our VXML Platform Engineers about this particular item, and I have some information for you. This should indeed be supported and we have opened an Engineering Feature Request (#846853) to have such support added. As this ticket was opened today, it's a bit difficult to estimate a date for the fix to be pushed to a live build, but we will certainly keep tabs on it and let you know when it becomes available. I apologize for the confusion and any inconvenience this may cause in your application porting. Best, Mike Thompson Voxeo Corporation |
|
safarishane
|
|
| Great news, thx! | |
dharma_sanah
|
|
| Hello sir,
can you please help me how to write a grammar to accecpt dtmf # or 5 digit zip code. here we a requirment for better understanding. _________________________________________________________________ "WakeHeart cares about your privacy. To verify your identity please enter your 5-digit billing zip code.To hear the main menu options press # " ________________________________________________________________ --->if it is only 5 digit number we can use built in grammer as follws <field name="authinitication" type="digits?length=5"> --->for pund key we can use grammar like this <grammar type="text/gsl">[dtmf-pound]</grammar> i need to combine these two cases its hould accept eigther # or 5 digit number for remaning cases it shoud say " invalid response" please help me on this one. |
|
VoxeoDustin
|
|
| Hey Dharma,
In order to accept DTMF # as a valid entry, we'll need a VoiceXML property to disable it as the default term character. ----- <?xml version="1.0"?> <vxml version="2.1"> <!-- here we disable # as the default term char --> <property name="termchar" value="abcd"/> ... ----- Here is an SRGS grammar that should do the trick for you. This will allow either a 5 digit entry or dtmf-#: ---- <grammar xml:lang="en-us" version="1.0" xmlns="http://www.w3.org/2001/06/grammar" root="TOPLEVEL" mode="dtmf"> <rule id="TOPLEVEL"> <tag> out.main = "" </tag> <one-of> <item repeat="5"> <ruleref uri="#ALPHANUM"/> <tag> out.main = out.main + rules.ALPHANUM.slot </tag> </item> <item repeat="0-1">#</item> </one-of> </rule> <rule id="ALPHANUM" scope="public"> <item> <one-of> <item> 1 <tag> out.slot=1 </tag></item> <item> 2 <tag> out.slot=2 </tag></item> <item> 3 <tag> out.slot=3 </tag></item> <item> 4 <tag> out.slot=4 </tag></item> <item> 5 <tag> out.slot=5 </tag></item> <item> 6 <tag> out.slot=6 </tag></item> <item> 7 <tag> out.slot=7 </tag></item> <item> 8 <tag> out.slot=8 </tag></item> <item> 9 <tag> out.slot=9 </tag></item> <item> 0 <tag> out.slot=0 </tag></item> </one-of> </item> </rule> </grammar> ---- You can access the resulting interpretation value from this grammar with the variable lastresult$.interpretation.main Let me know if we can be of further assistance. Regards, Dustin Hayre Customer Support Engineer 2 Voxeo Support |
|
shobs
|
|
| Is it possible that a character used as termchar be also used as a valid grammar?
E.g. Enter the number and press *. To cancel press * |
|
voxeoblehn
|
|
| Hello,
This is not possible if both are active at the same scope. Meaning, if the termchar is set at the field level and * is part of the active grammar in the field, this will not work. Please let us know if you have any additional questions or concerns. Regards, Brian Lehnen Voxeo Support |
|
rachit_gupta
|
|
| Hi All,
how can we activate both dtmf and grXML grammar at the same time,is this procedure correct <grammar type="application/srgs+xml" root="s1" version="1.0"> <grammar src="builtin:dtmf/digits?length=1"/> <rule id="s1" scope="public"> <one-of> <item>summer of 69</item> <item>its my life</item> </one-of> </rule> </grammar> <filled> </filled> then inside the filled element we can check for both dtmf or speech input. |
|
voxeoTonyT
|
|
| Hello,
To be compliant you would need to create two separate grammar blocks so you have one block for voice and another grammar block for dtmf. View the mixed mode grammar section on this [link=http://www.vxml.org/grxml_dtmf.htm]page[/link] for a detailed explanation. If there is anything else we can help you with please do not hesitate to contact us. Regards, Tony Taveras Customer Engineer Voxeo Support |
|
jananiskumar
|
|
| Hi
I have a requirement where I have to return some value for the DTMF pressed. Like, if caller presses 1 the field should be assigned "help". Would appreciate any help on this, Thanks |
|
voxeoJeffK
|
|
| Hello,
This is accomplished using slot returns as detailed here: http://www.vxml.org/grxmlslots.htm As an example you just assign the slot return to the matching input item: <rule id="MYRULE"> <one-of> <item> 1 <tag>out.MySlot="help";</tag> </item> </one-of> </rule> Regards, Jeff Kustermann Voxeo Support |
|
jkretz
|
|
| Questions on builtin grammars.
1) Language support. For example when I specify: <field name="question" type="boolean>... will that support spanish as in "si"? 2) When I specify the grammar as: <grammar src="builtin:grammar/boolean"/> the prompt is looking at my server for the grammer not yours as in question 1. Am I doing something wrong? 3) If I wanted to have a grammar of "yes/no/repeat" can I still use the builtin grammar for boolean and add a separate grammar for repeat, and if so what would that look like. Thanks. |
|
VoxeoDustin
|
|
| Hello,
The [code]<field type="...[/code] reference only supports US English built-in grammars on our hosted environment. It is possible to use other built-in grammar languages with [code]<grammar src="builtin:grammar/boolean"/>[/code], however this requires that the built-in grammars be installed at the base-uri of the application. The ASR vendor would need to provide these with their ASR language packs, and Nuance no longer provides these with their product. They did provide them in GSL format with Nuance 8.5, but not with Nuance 9 which only supports SRGS natively. You may want to take the available English grammars and convert them to Spanish in order to use these. Regards, Dustin Hayre Solutions Engineer Voxeo Corporation Come join us at our Voxeo Customer Summit, June 21st - June 23rd at the Hard Rock Hotel. Register today for your [url=http://www.voxeo.com/summits/customer]All Access Pass[/url]. |
| login |
|