| 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">| ANNOTATIONS: EXISTING POSTS |
StephenLewis
|
|
| One item of note many developers encounter is with the maximum length of the builtin grammar type of "digits." This grammar caps the numeric input at 16 digits, just lengthy enough for credit card values to be entered. For longer numeric capture, you must code your own customer grammar.
-SJL |
|
marmor
|
|
| I would like more info on the built-in "time" grammar. When using DTMF tones, does it only work in 24-hour mode, or is there a way to toggle AM/PM? | |
Michael.Book
|
|
| Howdy "marmor,"
You are correct. When using DTMF entry for the built-in field type 'time', one would have to use military/24-hour time. AM/PM is automatically determined, and displayed as "a" or "p" at the end of the interpretation string. For instance: If I press "0, 2, 3, 0", the interpretation will be "0230a"... If I press "1, 4, 3, 0", the interpretation will be "0230p"... When using voice input for the 'time' field type, either 24-hour military time, or standard 12-hour clock including AM or PM is acceptable. The interpretation will use the same format as above, regardless of which you use. I hope this helps... Have Fun, ~ Michael |
|
MrHyde
|
|
| Hi,
I have a question about the difference between digits and numbers and what would be best. I've got an application that takes in a 3 digit number, but there are different ways people could say it. For eg 113 could be said as one one three, one thirteen, one hundred and thirteen, eleven three. What would be the best way to capture this? I am leaning towards digits, but it resolves "one hundred and thirteen" and 10013. Cheers, MrHyde |
|
JimMurphy
|
|
| Mr. Hyde.
You could try, using a built-in grammar of type="number". Or you could author a custom grammar. I believe we have one that may fit the bill included in our grammar download pack (numbers2sixteen.grammar) located at: http://evolution.voxeo.com/library/grammar/library.jsp You may have to add a "hundred" rule in there, but the hard work is really done. Important to mention is that you'll want to look at the real-time logger and see exactly what is returned on a match. I say this because a grammar may return "312", but how it read back is within your control. Using the <sayas> element (http://docs.voxeo.com/voicexml/2.0/say-as.htm), you may be able to manipulate how this number is read back through TTS. eg. <prompt>testing interp as type digits <break strength="medium"/> <say-as interpret-as="number" format="digits">123</say-as> </prompt> will be read back "One Two Three" whereas: <prompt>testing number <break strength="medium"/> <say-as interpret-as="number">123</say-as> </prompt> will be read back "one hundred twenty three". What really matters is the literal return value from the grammar. From there, you have some control. I hope that helps. Jim |
|
funkycowboy
|
|
| Concerning the built-in grammer "boolean", it states it accepts voice and/or dtmf. I need for it to just respond to dtmf. Is this possible with this sbuilt-in grammar or will i have to write a custom grammar for this? | |
MattHenry
|
|
|
Hi there, In order to allow for this bit of functionality, you would want to use the 'inputmodes' property at the field scope, and set this to 'dtmf'. Check appendix H for details on how to implement this in your app. ~Matthew Henry |
|
yana
|
|
| I need to use the digit type. And I should to use timeouts: timeout,interdigittimeout and termchar. If this is correct:
<field name="input_digits" type="digits?minlength=3; maxlength=3" timeout = "1s" interdigittimeout = "10ms" termchar = "#"> ......... </field> |
|
sidvoxeo
|
|
| Hi,
If you are using timeout,interdigittimeout and termchar , you cannot use it as an attribute of the field element. You need to add it in the code as a property element in the document or the dialog scope. For example: <property name="" value=""/> Let me know if you have any other questuions. Thanks Sid |
|
sildev1
|
|
| For the built in digits type, is it possible to use ECMA Script to dynamically alter the length attibute. Consider the case where a prior field was used to determine the type of credit card. If the recipient said AMEX then the length would be 15, if the recipient said VISA the length would be 16.
-BTOC |
|
MattHenry
|
|
|
Brian, Per my testing, I don't think this is going to be allowable. You could, however setup two fields that are based on conditionals to get by this: <field cond="previousField == 'AMEX'" type="digits?length=15"> </field> <field cond="previousField == 'VISA'" type="digits?length=16"> </field> ~Matt |
|
bryant07
|
|
| Are there any built-in grammars that can be used for capturing, for example, serial numbers via voice?
We use the digits type to capture order number information, but it seems incapable of recognizing anything alphanumeric. Our application needs to allow the caller to speak a tracking number, which may contain letters in addition to numbers. I can create a custom grammar if necessary.. but it's hard for me to believe this isn't common enough that one doesn't already exist. I am relatively new to vxml and would appreciate any direction you can offer. Bryant |
|
mikethompson
|
|
| Hi Bryant,
Currently, we do not have any builtin grammars which cover alpha-numeric input. I have to caution you that arbitrary alphanumeric recognition is one of the most difficult things to accurately capture (B sounds like D sounds like E, etc...). If you do a search on our user forums for 'alpha' and 'alphanumeric', you'll doubtlessly find several instances of my 'alphanum manifesto' that explains why this is so difficult. Some useful bakground links/tutorials are also included, as they bear on this topic: http://docs.voxeo.com/voicexml/2.0/t_14_mot.htm http://docs.voxeo.com/voicexml/2.0/t_20.htm http://docs.voxeo.com/voicexml/2.0/w3cprops.htm Best of luck! Mike Thompson Voxeo Corporation |
|
andros
|
|
| I have three fields.
The first of which is of type: number The second I wish to be text. The third is a number again. When I leave the second type blank, i get an error. Is there a text type? I do not see it in the list. New to this today. |
|
MattHenry
|
|
|
Hi there Andros, Welcome to the world of IVR development; you have come to the right place for your education! =) For a "text/spoken input" grammar, any utterance to be recognized needs to be user-defined if it isn't covered by a built-in grammar. Check the below links for information on how you can write ba simple, (or complex!), voice grammar for your callers: http://www.voicexmlguide.com/t_2.htm http://www.voicexmlguide.com/mot_appendixi.htm Regards, ~Matthew Henry |
|
saran
|
|
| Dear Voxeo Support,
First of all, your site and support are great. Myself and my colleagues are impressed with your free developer accounts, site, documentation and support. You guys are awesome ! We have been playing with some of VoiceXml features using free developer account on your platform. I've been trying to use built-in grammars in the grammar shown below. I am getting error when trying to use this grammar in a VoiceXml form. I guess I need to use the (full) correct URI for the built-in grammar. Please advise. <grammar type="application/x-gsl" mode="voice" > <![CDATA[ .TOPRULE [PHRASES {return ($return)}] PHRASES (thank you <builtin:grammar/digits>) {return ($return)} ]]> </grammar> Thanks in advance, Ramesh |
|
MattHenry
|
|
|
Hello Ramesh, Bear in mind that it is a bit difficult to diagnose the problem, as I don't have much in the way of information as to the platform that you are using, or the exect error that you are seeing. However, I don't think that your method of referencing a builtin grammar within an inline subgrammar is going to be allowable. I might suggest that if you wish to include any builtin grammar types in this sort of fashion, that you reference a local instance of the grammar by downloading our grammar library and doing a GSL rule reference explicitly. Check the zip file of grammars below, and take a close look at the "numbers2sixteen.grammar" file contained therein. http://evolution.voxeo.com/library/grammar/grammars.zip Regards, ~Matthew Henry |
|
saran
|
|
| Thanks Matt. I will follow your suggestion. | |
sreeni
|
|
| Hi,
I worte a custom grammar for social security number. It is to reco "o" instead of "0" etc. The gramamr compiles without errors adn the ASR recoginizes right. But it returns the results as 9 seperate number. But I wanted it together so that I can send it to the backend. Any ideas on how I can accomplish this. The grammar is <?xml version="1.0" encoding ="iso-8859-1"?> <grammar version="1.0" xmlns="http://www.w3.org/2001/06/grammar" xml:lang="en-US" type="application/srgs+xml" mode="voice" roo t="social"> <rule id="social" scope="public"> <item repeat="9"> <ruleref uri="#number" /> </item> </rule> <rule id="number" scope="private"> <one-of> <item tag="0">0</item> <item tag="0">zero</item> <item tag="0">o</item> <item tag="1">1</item> <item tag="1">one</item> <item tag="2">2</item> <item tag="2">two</item> <item tag="3">3</item> <item tag="3">three</item> <item tag="4">4</item> <item tag="4">four</item> <item tag="5">5</item> <item tag="5">five</item> <item tag="6">6</item> <item tag="6">six</item> <item tag="7">7</item> <item tag="7">seven</item> <item tag="8">8</item> <item tag="8">eight</item> <item tag="9">9</item> <item tag="9">nine</item> </one-of> </rule> </grammar> The result I see in the ASR is 2006-12-07 15:29:05.000509 Test.jsp:SSN:zero 5 zero 3 eight eight two three five |
|
MattHenry
|
|
|
Hi there, I can't say for absolute certain why your grammar is not working properly, as I don't have access to the third-party IVR platform that you are working with: It's not really our habit to provide debugging support for our competition for our competitors, as I'm sure you can understand. however, I do have a suggestion or two: 1 - You should be able to simply use a builtin field type grammar to handle your SSN input, along the lines of this: <field name="SSN" type="digits?length=9"> 2 - You might try changing your grammar return values in the "tag" attribute to look like this: <item tag="(0)">0</item> Best of luck! ~Matthew henry |
|
yana
|
|
| Hi!
Thanks for help. The grammar works correct now. I have two more questions: 1. I do not use the termination key. I tried to a fiew option, without it and "termchar=", but the # still detected. How I shoult to put it off? 2. If I have previous vxml page with paly+bargein and press some digits, it collect. Now in the grammar it use them. How I should clean all digit buffer? Best regards |
|
VoxeoBrian
|
|
| Hello Yana,
I will answer your questions in separate to make sure I fully answer each question as best I can with the information you have provided. 1)If you are using VoiceXML 2.0 on our hosted network you can set termchar value="@" and that will disable pound from terminating. If you are using Prophecy in both hosted or local install you can set termchar value="foo" and that again will disable dtmf pound termination. 2)I am not quite sure I understand your second question, you are using the gsl built-in digits grammar and want to know how or if you need to clear the cache, if there was one? Please help to clarify your last question and I would be more then happy to address it more effectively. Regards Brian |
|
yana
|
|
| Hello Brian!
Thanks for help. The first question is cleare, work both options! About second issue. This is my vxml: <field name="Input_Digit" type="digits?minlength=6;maxlength=6"> <prompt bargein="false"> <audio src="http://1.wav"/> </prompt> <prompt bargein="true"> <audio src="http://2.wav"/> </prompt> ..... If I press some digits during first prompt it collects them end returns with digist pressed during second prompt. I should to collect digits that was pressed during only last prompt. Thanks |
|
MattHenry
|
|
|
Yana, Assuming that I am understanding you correctly, there isn't neccessarily a way to ignore input to a reco field on a "temporary" basis: If a user inputs a keypress during prompt #1, then we will either ignore it, or accept it -immediately-, with no real "middle ground". ~Matt |
|
arjunpatel
|
|
| hi
i am new candidtae of voxeo, i am not able to ues the build-in grammer of VXML plese show me the simple example for this. we wants to incoepotar this VXML with J2EE thech. thanks, Regarda, Arjun patel |
|
jbassett
|
|
| Hello,
You should be able to use an example from the tutorials just fine. For example, a field that you would like a user to input 9 numbers would look like this. <field name="SSN" type="digits?length=9"> If you are having trouble getting this to work, please don't hesitate to open a ticket in our support forums. Thanks Jesse Bassett Voxeo Support |
|
arjun3000
|
|
| hi,
i have a problem that when i call my application thru the SIP Phone i recive an messege on that SIP Phone that "can not place a call: remote number is busy (603)". plese send me the perfect solution of this problem . Regards , Arjun Patel |
|
jbassett
|
|
| Hello,
To get down to the bottom of this issue (if you are still having it) I would advise you to open a support ticket. You can log into your account, choose "Extreme Support" and then choose "support tickets". If you have any problems creating a ticket, please let me know. Thanks, Jesse Bassett Voxeo Support |
|
aleph2012
|
|
| Hello,
I am trying to use the built-in "date.grammar", and was wondering if you had some sample code I could look at? It seems to allow the date to be entered in various different formats, and I am not quite sure how to use the returned values. Thanks Satish |
|
VoxeoBrian
|
|
| Hello,
We have great documentation on GSL grammars in our VoiceXML documentation, please find a link to them below. http://docs.voxeo.com/voicexml/2.0/mot_appendixi.htm In addition I provided a code sample from a external GSL subgrammar and its invoking VXML file for your review. This should give you and idea of how the utterance and return values are used. MySubG.grammar ;top level rulename MYRULE [ NAME:d {<MyName $d>} ] ; sub-rule NAME ( ; assign results from 'FIRSTNAME' to slot 'a' FIRSTNAME:a ; assign results from 'MIDDLENAME' to slot 'b' MIDDLENAME:b ; assign results from 'LASTNAME' to slot 'c' LASTNAME:c ) ; concatenate results from slots a, b, and c and return {return(strcat($a strcat($b $c)))} FIRSTNAME [ [matthew] {return("matthew ")} ] MIDDLENAME [ [warren] {return("warren ")} ] LASTNAME [ [henry] {return("henry ")} ] SubGrammarFile.vxml <?xml version="1.0"?> <vxml version="2.0"> <form id="MainMenu"> <field name="MyName"> <prompt> Please say your first, middle, and last name. </prompt> <grammar src="MySubG.grammar#MYRULE" type="text/gsl"/> <filled namelist="MyName"> <prompt> You said <value expr="MyName$.interpretation.MyName"/> </prompt> </filled> </field> </form> </vxml> Please let me know if this helps to clarify for you, as well if you have any additional questions we are standing by to assist. Regards Brian |
|
alexey.timofeev
|
|
| Hello!
There is a point about built-in grammars I do not understand completely. For example there is such vxml-template: <form id="q1"> <field name="num" type="digits?length=5"> <prompt>Please enter 5 digits</prompt> <nomatch> <prompt>I did not understand that</prompt> <goto next="#q1"/> </nomatch> <noinput> <prompt>I did not understand that</prompt> <goto next="#q1"/> </noinput> </field> <filled> <assign name="new_num" expr="num"/> <goto next="#q2"/> </filled> </form> I expected from this template that the subscriber can entered exact 5 digits - not less or more and if the subscriber entered more than 5 digits the template has to prompt "I did not understand that" and makes the subscriber to try to enter the digits once more. But actually it works like that: -it passes on to the "q2" with just cutting the entered digits to a proper size. So if it was entered "123456" it assigns to the variable "new_num" the value "12345". |
|
mikethompson
|
|
| Hi Alexey,
The behavior you're experiencing is indeed the intended behavior of the built in digits grammar with a length of 5. That is, once our recognizer receives the 5th DTMF keypress, it immediately realizes the input is complete and sends it over to the <filled> element for content execution. At that point, the ASR was no longer listening so the remaining DTMF keypresses were ignored. If you're going to utilize the ?length parameter with built in grammars, you should make sure the caller is fully aware of the length expected. Hope this helps, Mike Thompson Voxeo Corporation |
|
mikejames
|
|
| When user presses the "star" key on the phone, I want to be able to capture it. Is there an easy way to capture "star"? I tried using type=digits but it didn't work. | |
VoxeoDante
|
|
| Hello,
In order to capture and use the *key you will need to code your own grammar. This may seem to be a daunting task, but it can be simple depending on the necessary implementation. The grammar can be something as simple as this. <grammar type="text/gsl"> [dtmf-1 dtmf-2 dtmf-3 dtmf-4 dtmf-5 dtmf-6 dtmf-6 dtmf-7 dtmf-8 dtmf-9 dtmf-star] </grammar> The reason the type=digits did not work is because this built-in grammar does not support the star key. Please try this out, and let me know how it works. All the Best, Dante Vitulano Voxeo Corp. |
|
shamim
|
|
| Hello,
i want to collect continous pin number(7 digit number) from user and when user enter his 7 digit pin number i want to repeat these entered pin number to user. Thanks |
|
voxeojeff
|
|
| Hello,
In order to accomplish this, you can utilize the built-in digits grammar, and specify a 7 digit length. Here's an example of what the input field could look like: <field name="F_1" type="digits?length=7"> <prompt bargein="false"> Please enter your seven digit pin number </prompt> <filled> <prompt> The pin you entered was <value expr="F_1"/> </prompt> </filled> </field> Regards, Jeff |
|
meksof1
|
|
| Hello,
i want to collect continous pin number(4 digit number) from user and when user enter his 4 digit pin number i want to test these entered pin number and if they are equal to '0000' the application say "that is correct". Thanks |
|
voxeojeff
|
|
| Hi there,
To accomplish this, you can do something like the following: <field name="F_1" type="digits?length=4"> <prompt bargein="false"> Please enter your four digit pin number </prompt> <filled> <if cond="F_1 == '0000'"> <prompt> that is correct. </prompt> <else/> <prompt> that is incorrect. </prompt> </if> </filled> </field> Hope this helps, Jeff |
|
SSA_Jott
|
|
| How would I do a variable length digit grammar followed by either an A or a B or neither?
Thanks, Matt |
|
VoxeoBrian
|
|
| Hey Matt,
Sadly this is not possible within the built in digits grammars, and it will require the use of a custom grammar to support alpha characters like A and B. Regards, Brian |
| login |
|