| 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="2008 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 |
| login |
|