| VoiceXML 2.1 Development Guide | Home | Frameset Home |
| enctype | Data Type: CDATA | Default: Optional (application/x-www-form-urlencoded) |
| The enctype attribute specifies the MIME type encoding for any data submitted via the namelist attribute. The two possible vales for this attribute are ‘x-www-form-urlencoded’, (default), or ‘multipart/form-data’, (for binary data submissions, such as recorded audio). When submitting recorded data, the voice browser will automatically set this value to ‘multipart/form-data’ and submit using the POST method. | ||
| expr | Data Type: CDATA | Default: Optional |
| The expr attribute evaluates to an ECMAScript value that defines the target URI. Either expr or next may be specified for the element, but not both. | ||
| fetchaudio | Data Type: CDATA | Default: Optional |
| The fetchaudio attribute specifies the URI of the .wav file to play to the caller in the event of an extended document fetch. Essentially, while the fetch is being made, it allows the developer to play some filler music to the caller rather than presenting only silence. | ||
| fetchhint | Data Type: (prefetch|safe) | Default: prefetch |
Fetchhint is used to specify when the resource should be fetched during application execution. The possible values and their descriptions are:
Note that the Voxeo platform will always prefetch content, regardless of what this attribute value is set to. As such, specifying a value is somewhat redundant. | ||
| fetchtimeout | Data Type: CDATA | Default: 5s |
| (Ignored attribute) The ‘fetchtimeout’ attribute is used to indicate how long, (in seconds or milliseconds), the interpreter should attempt to fetch the content before throwing an error.badfetch exception. | ||
| maxage | Data Type: CDATA | Default: Optional |
| The maxage and maxstale attributes replace the VXML 1.0 caching attribute for compliance to the w3c vxml 2.0 specification. The value for this attribute specifies the maximum acceptable age, in seconds, of the resource in question. However, it is strongly advised not to rely on this attribute for cache-control; caching is always best controlled by the hosting server's response headers. If no headers are specified, then no cache control will be present, regardless of the value set for the maxage and maxstale attributes. | ||
| maxstale | Data Type: CDATA | Default: Optional |
| The maxage and maxstale attributes replace the VXML 1.0 caching attribute for compliance to the w3c vxml 2.0 specification. The value for this attribute specifies the maximum acceptable staleness, in seconds, of the resource in question. However, it is strongly advised not to rely on this attribute for cache-control; caching is always best controlled by the hosting server's response headers. If no headers are specified, then no cache control will be present, regardless of the value set for the maxage and maxstale attributes. | ||
| method | Data Type: (GET|POST) | Default: Optional (GET) |
| The method attribute specifies the HTTP method to use when sending the request. If unspecified, then the value of ‘GET’, (default) is assumed, unless the submission of multipart/form-data is encountered, in which case the implied method will be ‘POST’. | ||
| namelist | Data Type: NMTOKEN | Default: Optional |
| The namelist attribute specifies a space-separated list of variables to send to the URI indicated by the next or expr attributes. Note that if the namelist attribute is left unspecified, then all input-item variables will be submitted to the destination URI. | ||
| next | Data Type: CDATA | Default: Optional |
| The next attribute specifies the literal URI, or URI fragment of where to transition the caller. The value can be a full URI: <submit next=”http://MyServer.com/MyFile.vxml”/> or a relative URI: <submit next=”MyFile.vxml”/> In addition, it can also indicate a particular form within the current document, where the pound sign precedes the form item name: <submit next=”#AnotherForm”/> Or lastly, it can indicate a specific form in another document: <submit next=”AnotherDocument.vxml#AnotherForm”> | ||
| <?xml version="1.0" encoding="UTF-8"?> <vxml version = "2.1"> <meta name="author" content="Matthew Henry"/> <meta name="copyright" content="2005 voxeo corporation"/> <meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/> <form id="F1"> <block> <var name="SomeCoolVar" expr="'SomeCoolMoeDeeValue'"/> <submit next="MyDestinationPage.jsp" namelist="SomeCoolVar" method="post"/> </block> </form> </vxml> |
| <?xml version="1.0" encoding="UTF-8"?> <vxml version = "2.1"> <meta name="author" content="Matthew Henry"/> <meta name="copyright" content="2005 voxeo corporation"/> <meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/> <form id="F1"> <block> <var name="Destination" expr="'MyDestinationPage.jsp'"/> <var name="AnotherCoolVar" expr="'SomeCoolValue'"/> <submit expr="Destination" namelist="AnotherCoolVar" maxage="5000" maxstale="5000" enctype="application/x-www-form-urlencoded"/> </block> </form> </vxml> |
| <?xml version="1.0" encoding="UTF-8"?> <vxml version = "2.1"> <meta name="author" content="Matthew Henry"/> <meta name="copyright" content="2005 voxeo corporation"/> <meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/> <form id="F1"> <block> <var name="SomeCoolVar" expr="'SomeCoolValue'"/> <prompt> preparing to submit. </prompt> <submit next="MyDestinationPage.jsp" method="get" fetchhint="safe" fetchaudio="MySoundFile.wav"/> </block> </form> </vxml> |
| ANNOTATIONS: EXISTING POSTS |
Asier
|
|
| Hello there,
I want know, how can i receive variables, from a php file Plase put some sample of code. Asier Thank you very much. |
|
MattHenry
|
|
| Asier,
In short, this is done in the very same manner as we would do with HTML. However, let's take a closer look at this: <form> <block> <?php //define a PHP variable $myVar1 = 'Asier'; ?> <!-- import it to VXML context --> <var name="myXMLvar" expr="<?=$myVar1?>"/> <log expr="'*** myXMLVar1 = ' + myXMLVar"/> </block> </form> Hope this helps, ~Matt |
|
Asier
|
|
| Hello there,
How can i receive a variable into of a document called??? i have: <submit next="vxmleng/bienvenida.vxml" namelist="hora"/> in the document bienvenida.vxml: i try receive the variable with: <var name="hora"/> I do it for receive any variable from a subdialog, but with the submit tag, not work. Thanks in advance, Asier. |
|
MattHenry
|
|
|
Asier, I think your question is answered in the following section of our documentation: http://www.voicexmlguide.com/qs_vars.htm Regards, ~Matt |
|
igor555
|
|
| Hi!
i want to pass a get/post variable to my vxml script: 1st script is: <vxml> <var name="myVar" expr="some data"/> <form> <block> <submit next="script2.vxml" namelist="myVar" method="get"/> </block> </form> </vxml> script2.vxml script is: <vxml> <form> <block> <var name="myVar"/> <prompt> my variable is <value expr="myVar"/> </prompt> </blocK> </form> </vxml> the result: myVar is empty i read http://www.voicexmlguide.com/qs_vars.htm and found no solution for such problem there. please advice thanks |
|
mikethompson
|
|
| Hey Igor,
The reason you are getting undefined is because using the namelist element is actually attaching that variable to your URI as a parameter (script2.vxml?MyVar=parameterValue). So when you are reaching this new document, you would need to use server-side scripting to pull the parameter value from the querystring. If you simply wish to use variables across document, you need to invoke an application root document. Basically, you have your main document that declares all of your "application" scoped variables so that they may be accessed anywhere in your leaf document. I could continue to explain, but it would be more beneficial to check out an example of a "root" document and accessing the root variables from a leaf document. -----root.xml----- <vxml version="2.0"> <property name="termtimeout" value="1"/> <var name="Var_1" expr="'foobar'"/> </vxml> -------leaf.xml------ <vxml version="2.0" application="root.xml"> <form> <block> <log expr=" '******Var_1:' + application.Var_1"/> <prompt> The value of Var 1 is now <value expr="application.Var_1"/> </prompt> <goto next="#F2"/> </block> </form> </vxml> NOTICE: The leaf document must reference the application root document via the "application" attribute in the vxml element. Also, as a matter of good practice, I try not to execute actual content in my root document. I usually use it strictly for storing variables that I want to be accessable via the entire application. As such, I typically map my application to hit the leaf document first and simply reference the application root document from there. This way, you don't have to hit your root document just to issue a <goto>. Let me know if you have additional questions. Regards, Mike Thompson Voxeo Extreme Support |
|
igor555
|
|
| for some reasons i cant use multi-document application here.
is there any way to pass variables from one vxml script to another without multi-document and server-side scripting(ASP, perl, PHP, etc.)? it does not matter what method to use - GET or POST |
|
MattHenry
|
|
|
Greetings Igor, To clarify on our erlier responses, there are two available methods of passing variables to a VXML document: 1 - <submit> the variables to a dynamic document, (ASP/JSP/etc), which has the abaility to parse dynamic querystring data. 2 - Use application-scoped variables, as Mike suggested VoiceXML, being a static markup, has no ability to read querystring data and import it back into the VXML context. Hope that this makes things clear, ~Matthew Henry |
|
khaled
|
|
| Hello,
I want know, how can i receive variables, from a php file to vxml file. khaled Thank you very much. --------------------------------- <?php include ("conn.php"); $p=0; conn(); //function to connect to database $sql = "select passwd from client"; $req = mysql_query($sql); if ($data = mysql_fetch_array($req)) {$p=$data['passwd'];} disconn(); ?> --------------------------------- <?xml version="1.0"?> <!DOCTYPE vxml PUBLIC '-//Voxpilot/DTD VoiceXML 2.0//EN' 'http://dtd.voxpilot.com/voice/2.0/voxpilot_voicexml-2.0.dtd'> <vxml version="2.0" xml:lang="en-GB"> <form id="get_password_db"> <block> <submit next="http://adresseserver/11.php" method="get" fetchhint="safe"/> </block> <block> <prompt> Your password from database is <sayas class="digits"> <value expr="p"/> </sayas> <break msecs="400"/> Bye </prompt> <goto next="#exit"/> </block> </form> </vxml> ------------------------------------ |
|
mikethompson
|
|
| Hi Chihaoui,
Our documentation actually has a tutorial explaining how to retrieve variables from the querystring (when passing them in via server-side) and use them in the VXML context. You can check out that tutorial right here: http://www.voicexmlguide.com/qs_vars.htm Hope this helps, Mike Thompson Voxeo Extreme Support |
|
bankapp
|
|
| I saw a lot of example on how to send/retrieve variables and what confuses me is:
If I want to use a php file that is on some other server, how do I connect it with the .vxml application on evolution.voxeo.com??? More precisely I want to be able to retrieve and store information in mysql database that is hosted on some other server. I know that voxeo does not support .php, .asp etc. Can I embed some dynamic language into my xml application, or is it other way around??? I got no problem with sending to remote .php file. The question is how do I retrieve the result of some computations??? |
|
jbassett
|
|
| Hello,
On voxeo's hosted staged environment, you can simply map your app to an external URL. You can even host the XML file yourself. You can map you app to any URL you like. Currently only XML, WAV and .GRAMMAR file extensions will work on our free developer platform, that is why we allow you point to your own hosted app so you can test with your own server side languages. As far as PHP, you can embed ou XML right into the PHP file. Go to this link http://www.voicexmlguide.com/qs_vars.htm and find Getdigits.php example. You will see an example of how to do this. Thanks Jesse Bassett Voxeo Support |
|
amalsafd
|
|
| Hello all;
First of all, thank you very much for this great site. I am using nuance V-Builders to build vxml application. I have Apachi server. my problem that after submitting any data to cgi perl program on the server and saving it into database. when I'm going back to my vxml application through <goto next="...."/>, it forget all the previous taken information. here is the code and details: First: root.vxml <?xml version="1.0"?> <!DOCTYPE vxml PUBLIC "-//Nuance/DTD VoiceXML 2.0//EN" "http://voicexml.nuance.com/dtd/nuancevoicexml-2-0.dtd"> <vxml xmlns="http://www.w3.org/2001/vxml" xmlns:nuance="http://voicexml.nuance.com/dialog" version="2.0"> <meta name="Generator" content="V-Builder 2.0.0"/> <!-- here I defined my global variables--> <var name="AdultCount" /> <var name="ChildCount" /> <var name="InfantCount"/> </vxml> Second: main.vxml <?xml version="1.0"?> <!DOCTYPE vxml PUBLIC "-//Nuance/DTD VoiceXML 2.0//EN" "http://voicexml.nuance.com/dtd/nuancevoicexml-2-0.dtd"> <vxml xmlns="http://www.w3.org/2001/vxml" xmlns:nuance="http://voicexml.nuance.com/dialog" version="2.0" application="root.vxml"> <meta name="Generator" content="V-Builder 2.0.0"/> <form id="FlightSearch"> <field name="AdultNo" > How many Adults we have? <grammar src="NonZeroDigits.grammar"/> <filled> <assign name="AdultCount" expr="AdultNo"/></filled> </field> <field name="ChildNo"> How many children are traveling ? <grammar src="NonZeroDigits.grammar"/> <filled> <assign name="ChildCount" expr="ChildNo"/></filled> </field> <block name="summary"> There are <value expr="AdultCount"/> adult passengers, <value expr="ChildCount"/> children, are going in this trip./> <submit next="http://localhost:8080/cgi-bin/count.cgi" method="post" namelist="AdultCount ChildCount"/> </block> </form> <form id="AdultDetails"> <block> Adult equal <value expr="AdultCount"/></block> <field name="AdTitle"> What is the title, please? <grammar> [mister mrs. miss] </grammar> </field> </form> </vxml> Third: count.cgi #!c:/Perl/bin/perl.exe -w use strict; use CGI qw(:standard); use Win32::ODBC; my $q = CGI->new(); my $adults = $q->param('AdultCount'); my $child = $q->param('ChildCount'); my $phrase = $q->param(''); $phrase = "The adults count is $adults while children are $child and finally infants are $infants"; my $db = new Win32::ODBC("IDDB"); $db->Sql("INSERT INTO Count (NoAdults, NoChildren) VALUES ('$adults', '$child');"); $db->Close(); print qq* <?xml version="1.0"?> <!DOCTYPE vxml PUBLIC "-//Nuance/DTD VoiceXML 2.0//EN" "http://voicexml.nuance.com/dtd/nuancevoicexml-2-0.dtd"> <vxml version="2.0"> <form id="response"> <var name="phrase" expr="'$phrase'"/> <block> <prompt>Data has been saved. <value expr="phrase"/></prompt> <goto next="http://STUDY-COMPUTER:8081/myApp/dialogs/main.vxml#AdultDetails"/> </block> </form> </vxml> *; Everything is going fine, the data will be submitted to the cgi file and will be saved in the database and will go to the form "AdultDetails" in the vxml file. The problem starts there when I found that the variable "AdultCount" and "AdultChild" in this example which is assigned before submitting to the cgi, is now getting again "undefined"! Can you help me with this please? Thanks Alot Amal |
|
sidvoxeo
|
|
| Hi there,
We would highly appreciate if you do not post server side script on the Voxeo Documentation Post. You may want to use the Forum posting or the support ticketing system to post server side scripts in the future. Let me explain your question "The problem starts there when I found that the variable "AdultCount" and "AdultChild" in this example which is assigned before submitting to the cgi, is now getting again "undefined"!" So when you go back from the CGI script to the Form id AdultDetails in the main vxml page the reference of the variables "AdultCount" and "AdultChild" are not within the scope of this form you are visiting. If you look back at code the "AdultCount" and "AdultChild" field variables are held within the form scope of FlightSearch. So I suggest you that you re-submit the variables with the value back to a server side script which will output the required vxml. Or you may want to use the variable scoping in order to address this issue. Hold the reference of those two variables outside the form scope and use it in another form. This may need you to re-structure your vxml code. Have a look at the documentation for http://docs.voxeo.com/voicexml/2.0/frame.jsp?page=varscoping.htm Let us know if you have any other questions. Thanks Sid |
|
amalsafd
|
|
| hi;
Thanks for your reply. You said: " If you look back at code the "AdultCount" and "AdultChild" field variables are held within the form scope of FlightSearch. So I suggest you that you re-submit the variables with the value back to a server side script which will output the required vxml. " If you looked again at my root.vxml, you'll find that I declared these variables there, so its scope is application itself not only the form FlightSearch scope. I didn't understand your suggestion clearly. Can you give me example? Let my question be more general, take this scinario: 1) In VXML dialog I declared variable in the root and assigned value to it. 2)I submit these variables (or even any other variables) to cgi file on the server and made some operations on the serever. 3) I used the <goto> to return back to my vxml dialog. Now my question: Is the normal and default thing that my dialog will forget any previous operation and start as from scratch? I have alos another question about retrieving data from server side: this is the cgi script: #!c:/Perl/bin/perl.exe -w use strict; use CGI qw(:standard); use Win32::ODBC; my $q = CGI->new(); my $adults = $q->param('AdultCount'); my $phrase = $q->param(''); $phrase = "The adults count is $adults "; my $db = new Win32::ODBC("IDDB"); $db->Sql("INSERT INTO Count (NoAdults) VALUES ('$adults');"); $db->Close(); print qq* <?xml version="1.0"?> <vxml version="2.0"> <form id="response"> <var name="phrase" expr="'$phrase'"/> <block> <prompt>Data has been saved. <value expr="phrase"/></prompt> <goto next="http://STUDY-COMPUTER:8081/myApp/dialogs/main.vxml#AdultDetails"/> </block> </form> </vxml> *; Here in the vxml part of the cgi I prompt the variable "Phrase". How I can send the value of this variable to the dialog in the vxml file I'm going to in <goto next...> to be able to use it in other stuffs not only prompting it in the cgi part? I wish that my question are clear and forgive me for my bad english. Thanks alot Amal |
|
sidvoxeo
|
|
| Amal,
To clarify on our earlier responses, there are two available methods of passing variables to a VXML document: 1 - <submit> the variables to a dynamic document, (ASP/JSP/etc), which has the abaility to parse dynamic querystring data. 2 - Use application-scoped variables. Now lets analyse the following snippet of code: <?xml version="1.0"?> <vxml version="2.0"> <form id="response"> <var name="phrase" expr="'$phrase'"/> <block> <prompt>Data has been saved. <value expr="phrase"/></prompt> <goto next="http://STUDY-COMPUTER:8081/myApp/dialogs/main.vxml#AdultDetails"/> </block> </form> </vxml> In this vxml document you are doing a goto next to main.vxml and to the form id AdultDetails correct? And you want to pass the variable "phrase" back to the main.vxml. Inorder to do this set a variable in the root document for example: root.vxml <?xml version="1.0"?> <!DOCTYPE vxml PUBLIC "-//Nuance/DTD VoiceXML 2.0//EN" "http://voicexml.nuance.com/dtd/nuancevoicexml-2-0.dtd"> <vxml xmlns="http://www.w3.org/2001/vxml" xmlns:nuance="http://voicexml.nuance.com/dialog" version="2.0"> <meta name="Generator" content="V-Builder 2.0.0"/> <!-- here I defined my global variables--> <var name="AdultCount" /> <var name="ChildCount" /> <var name="InfantCount"/> <var name="MyPhrase"/> </vxml> And change the following code to <?xml version="1.0"?> <vxml version="2.0" application="root.vxml> <form id="response"> <var name="phrase" expr="'$phrase'"/> <assign name="application.MyPhrase" expr="phrase"/> <block> <prompt>Data has been saved. <value expr="phrase"/></prompt> <goto next="http://STUDY-COMPUTER:8081/myApp/dialogs/main.vxml#AdultDetails"/> </block> </form> </vxml> Now in the Main.vxml page you can reference application.MyPhrase. Let me know if this posting makes sense. Thanks Sid |
|
amalsafd
|
|
| Thank you very much. I really apperiate your help.
It was clear step and finally I can pass variables to vxml. It works very fine. However the first problem is still there. I lose any variable that I assigned before going to cgi. In my previous example, I lose the value assigned to AdultCount when I return back to my main vxml eventhough I use now application.AdultCount and declared it in the root file and assigned a value to it before submitting it to cgi. eventhough that I added "application="root.vxml" in the vxml part of the cgi file. so again is that normal and i have to retrieve these data from the saved database everytime I want to use it? Thanks alot Amal |
|
MattHenry
|
|
|
Amal, As this problem is application scoped, it might be best to create a seperate account ticket tat contains application debugger logs so that we can make an assessment as to where the problem lies with your incarnation of the code: http://docs.voxeo.com/voicexml/2.0/gettingsupport.htm Standing by, ~Matthew henry |
|
sildev6
|
|
| Hello,
When I <submit> a form using method="POST" and namelist="var1 var2....", are *all* the form variables submitted or just the variables specified in the "namelist" attribute? Thanks |
|
MattHenry
|
|
|
If a namelist is specified, then only the variables denoted will be POSTed to the submit destination. If the namelist attribute is left unspecified, then all input-item variables will be submitted to the destination URI. Cheers, ~Matt |
|
sildev6
|
|
| Thanks for your reply, Matt!
But I am seeing a different behaviour. I am submitting a page to itself with a submit tag similar to <submit method="POST" namelist="var1 var2...." next="same_page"> and I get a semantic error saying "<form> has a duplicate form item named "abc". The item "abc" is a <field> item in the form and it is *not* part of the namelist attribute. So basically, I have something like <form> <field name="abc" type="boolean"> <prompt> Are you sure?</prompt> <filled> <if cond="abc==true"> <var name="var1" expr="'1'"/> <var name="var2" expr="'2'"/> <submit method="post" namelist="var1 var2" next="same_page"> </if> </filled> </field> </form> I am testing on VoiceCenter 5.5. Any idea why I get the semantic error? Thanks! |
|
sildev6
|
|
| Hello,
Re: my last post about duplicate <form> item. Problem fixed. Thanks! |
|
terriblecow
|
|
| So I'm startin to get the hang of this vxml thing and i like it :)
I do have a question that you guys out there may be able to answer for me though. I'm writing a generic recordMessage page and the vxml I'm using is below. It's based off another example here on the site. Here's the question: I'm using the fetchhint="safe" attribute of the submit tag to ensure that this submit happens after the prompt telling the user that its gonna happen. But I'm consistently seeing the form submit to the server before the prompt has even started? Am I misusing the attribute? or am I missing something else? Any pointers or clues would be appreciated. Thanks <?xml version="1.0" encoding="UTF-8" ?> <vxml version="2.1" xmlns="http://www.w3.org/2001/vxml" > <form id="main"> <record name="CallersMessage" beep="true" maxtime="60s" finalsilence="2500ms" type="audio/wav"> <prompt> Record your message after the beep. </prompt> </record> <field name="eraseMessage" type="boolean"> <prompt> This is your recording: <value expr="CallersMessage" /> Do you want to erase it and try again? Say yes or no. </prompt> <filled> <if cond="eraseMessage"> <goto next="#main"/> <else/> <goto nextitem="save"/> </if> </filled> <noinput> <goto nextitem="wantrecord" /> </noinput> </field> <block name="save"> <prompt> Okay, we'll save your recording. Your recording was excellent. Thank you. </prompt> <goto nextitem="submitData" /> </block> <block name="submitData"> <submit next="RecordMsg.aspx?askName=james" method="post" namelist="CallersMessage" enctype="multipart/form-data" fetchhint="safe" fetchaudio="sounds/fetchaudio.wav"/> </block> </form> <form id="wantrecord"> <field name="b" type="boolean"> <prompt> I didn't hear you say anything. Do you want to try again? Say yes or no.</prompt> <filled> <if cond="b"> <goto next="#main" /> <else /> <goto next="#norecord" /> </if> </filled> </field> </form> <form id="norecord"> <block> Okay, you don't have to record anything if you don't want to. </block> </form> </vxml> |
|
jbassett
|
|
| Hello,
I have opened a ticket # 340036 on your account so we can dive into your issue. You will receive updated on the ticket to the email address you signed up with. Thanks, Jesse Bassett Voxeo Support |
|
jorgeivanmm
|
|
| hi, i am working with voxeo prophecy, and i am doing an application but i have a problem. i am making dinamic pages using JSP, and i have made a folder inside the Webapps folder of Voxeo. but the problem is for the submit element. when i run the first file, using the SIP PHONE the file runs well but it say me that there is a error in the submit element but i don't know what the problem is. somebody help me.
the file is the next and is inside a folder name VXML: <?xml version="1.0"?> <%@ page import="java.util.*" %> <%@ page import="java.lang.*" %> <%@ page import="tesis.*" %> <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml" xmlns:voxeo="http://community.voxeo.com/xmlns/vxml"> <form id="usuario"> <property name="inputmodes" value="voice"/> <field name="nmb" modal="false"> <prompt> Please say your name </prompt> <grammar mode="voice" root="name" tag-format="semantics/1.0"> <rule id="name" scope="public"> <one-of> <item tag="carlos"> carlos </item> <item tag="ivan"> ivan </item> <item tag="jorge"> jorge </item> <item tag="andres"> andres </item> </one-of> </rule> </grammar> <nomatch count="1"> Sorry, No Match! <reprompt /> </nomatch> <noinput count="1"> You didn't say anything <reprompt /> </noinput> <filled> <prompt bargein="false"> Looks like you said <value expr="nmb" /> </prompt> </filled> </field> <form id="confirmation"> <field name="res" modal="false"> <prompt> the information collected is correct? </prompt> <grammar mode="voice" root="con"> <rule id="con" scope="public"> <one-of> <item tag="yes"> yes </item> <item tag="not"> not </item> </one-of> </rule> </grammar> <filled> <prompt> you said <value expr="res"/> </prompt> <if cond="res=='not'"> <goto next="#usuario"/> <else/> <goto next="#envio"/> </if> </filled> </field> </form> <form id="envio"> <block> <submit next="Validacion.jsp" namelist="nmb" method="post"/> </block> </form> </vxml> the file runs well but the error are in the submit element, what is the error??? i don't know, please help. the file Validacion.jsp are inside the folder VXML along with the previos file. what is the error in the submit??? |
|
mikethompson
|
|
| Hi there,
Initially reviewing your code, I do not see any glaring issues. This being said, the next best step is to provide us with the output from the Prophecy LogViewer. 1) Open the Prophecy debugger window 2) Call the application, and reproduce the error 3) Select all logger output, (Ctrl+A) 4) Copy log output to a .log file, (Ctrl+V) 5) Attach the log file to the ticket With this information in-hand, we can offer you an accurate, speedy resolution to the coding problem: http://docs.voxeo.com/voicexml/2.0/gettingsupport.htm If you have personal information in your logs which you do not wish to be exposed in a public forum, let me know and we can open a private account ticket for this issue. Regards, Mike Thompson Voxeo Corporation |
|
sowmya.saravanan
|
|
| hello there,
I wanna know how to pass the variables from the ccxml file to a jsp page.i need some sample code to proceed with my application.please help. ~sowmya Thanks |
|
mikethompson
|
|
| Hello Sowmya,
Our CCXML documentation illustrates how one can send CCXML variables over to a server-side document, then pull those variables via server-side scripting. It is illustrated in PHP, but it should give you the right idea regarding the best process. http://docs.voxeo.com/ccxml/1.0-final/appendixg_ccxml10.htm Hope this helps, Mike Thompson Voxeo Corporation |
|
MattHenry
|
|
|
One point of confusion that comes up when using fetchaudio is how this affects prompt queuing and document fetching. Note that prompt queueing and prompt execution are two entirely separate hings, and it is strongly advised that developers who are interested in this topic closely read the specification for clarity on the difference: http://www.w3.org/TR/voicexml20/#dml4.1.8 As this topic has come up a few times, it seemed as if we should illustrate this in a little greater detail, so here goes: When you declare the fetchaudio property, this will clear the prompt queue, and thus play the <prompt> within your block that does the submit prior to the submission. One thing that is important to remember here is that this can cause some confusion when executing TTS and audio resources. For instance, assume the following document that submits data: <form> <field name="F1"> <audio src="audio_1.wav"/> .. <filled> <audio src="standby.wav"/> <submit next="target.jsp" namelist="F1" fetchaudio="pulse.wav"/> </filled> </block> </form> And further take into account that the XML output of "target.jsp" looks like this: <form> <block name="B2"> <audio src="audio_2.wav"/> <exit/> </block> </form> The chronological order of audio execution in this case will be as follows: 1) audio_1.wav 2) user input is gathered 3) standby.wav 4) document fetch occurs 5) pulse.wav (fetchaudio) 6) audio_2.wav But what happens is we take out the 'fetchaudio' attribute from the <submit> in our invoking document? Here is where things get a little confusing, but bear in mind that this order of execution is per the specification: 1) audio_1.wav 2) user input is gathered 3) document fetch occurs 4) standby.wav 5) audio_2.wav I hope that this will help to proactively save some time & frustration for our developers as applications are in the formative stages, rather than finding out about this at the last minute. ~Matt |
|
chuchoomar
|
|
| the audio file does not need a special characteristic in duration? or once the submitt element is executed and entered to the next page provided by the attribute next the sistem finished the audio file and continue with the other vxml file(the next page) ..... as it works internally? | |
VoxeoDustin
|
|
| Hey Chuchoomar,
If I understand what you're asking, you'll want to use the 'fetchaudiominimum' property to set how long the fetchaudio file should be played: <property name="fetchaudiominimum" value="10s"/> This example will tell the VXML browser to play the audio file for 10 seconds, regardless of how long the fetch takes. This allows you to mask the fetch event with, for example, an advertisement or information and know that your message will not be cut off. Cheers, Dustin |
|
jaffar
|
|
| <block>
<submit next="mypage1.jsp"> <goto nextitem="day"> </block> IF I SUBMIT TO A JSP PAGE FROM A VXML .COLLECT THE DATA FROM JSP... HOW CAN I COME BACK TO OUR SAME VXML...FROM THE JSP... IS THERE ANY ELEMENT TO TAKE BACK THE DATA.. PLZ GIVE ME SOME EXAMPLES... THANK YOU |
|
jefo12
|
|
| how to submit a recorded file to a jsp plz giv me an example...
<record name="R_1" beep="true" dtmfterm="true"> <prompt> here you will hear a beep indicating that you should start your recording. </prompt> <prompt> after you are finished, you may press any DTMF key to indicate that you are done recording. </prompt> I hav to submit this recording to a jsp.and stored it into the database.... plz give me suggestion |
|
VoxeoDustin
|
|
| Hey Jefo,
I unfortunately do not have an example of doing this with JSP, but I do have one using PHP that should give you an idea of how to get started and I've attached the example below. Cheers, Dustin |
|
jefo12
|
|
| <vxml>
<var name="callerid" expr="session.callerid"/> <form id = "callerid"> <field name="caller"> <grammar type= text/gsl mode="dtmf"> [dtmf-1 dtmf-2] </grammar> <prompt> if you are a new user press 1 else if u hav already an appointment press 2 </prompt> <filled> <block> <If cond="caller=='dtmf-1'"> <goto next="F1"> <else/ > <goto next ="welcome"> </filled> <form id="welcome"> <field name="cancelres"> <grammar type="text/gsl"> [cancel reschedule]</grammar> <prompt > wat do u want to cancel or reschedule the appointment </prompt> <filled> <block> <subdialog name="getdetails" src="mydoc.jsp"/> //WHERE TO STORE THE VALUES COMING FROM JSP AND HOW TO PLAY THE CORRESPONDING DATE AND TIME.. </block> </field> </form> <form id ="newapp"> <field name="consult"> <prompt bargein="false"> welcome to abc phone appointmentscheduling.please request the date for your appointment. To request an appointment this week you can say today,tomorrow ,day after tomorrow or a specific day such as this Friday.you can also request the day next week such as next Friday.plz make ur request now Such as today,tomorrow,day after tomorrow,this Friday or next Friday. </prompt> <grammar type="text.gsl"> [today tomorrow dayaftertommorrow Sunday Monday Tuesday Wednesday Thursday Friday Saturday (next Sunday) (next Monday) (next Tuesday) (next Wednesday) (next Thursday) (next Friday) (next Saturday) morning afternoon evening] </grammar> //IS THERE ANY EASY WAY WITHOUT WRITING ALL THESE DAYS... //IF THE USER SAYS A SPECIFIC DATE SUCH AS MARCH 2ND HOW TO INCLUDE GRAMMAR FOR THAT <filled> <block> <goto nextitem="day"> </block> <filled> <field name="day"> <grammar type="text.gsl"> [morning evening] </grammar> <prompt>please indicate your time facult by saying morning or afternoon</prompt> <filled> <subdialog name="availabletimes" src="mypage.jsp">//HOW TO play all available timings on that date.. </subdialog> <field name="confirm" type="boolean"> </filled> <block> <if cond="confirm=='yes'"> Then play the exact appointment day,date and time.. <elseif cond="confirm='no'"> <goto nextitem="day"> </block> </field> </form> </vxml> ABOVE IS THE CODE FOR APPOINTMENT SCHEDULING PLZ VERIFY WHETHER IT IS VALID OR NOT ..IF NOT GIV ME THE EFFICIENT VXMLCODE. |
|
VoxeoDustin
|
|
| Hey Jefo,
Attached is grammar that supports date entry, including day of the week, day, month and year. You can implement this grammar by using the following syntax: <grammar src="SRGS_date.xml" type="application/grammar+xml"/> Give this a try and let us know if it's what you're looking for. Cheers, Dustin |
|
azeta_ambrose
|
|
| Hello All and Voxeo team,
I wrote and uploaded a peice of voicexml code to submit username and password from voicexml document to a php file hosted in an apache web server with http link below, but what i am getting is "internal error in gateway software", when execution get to the submit statement. I hosted the voicexml file in voxeo network and it ask me for username and password, but when i supply the username and then the password, all i hear is this error - internal error in gateway software. Please forum members, has body succeeded in sending some variables from vxml document hosted in voxeo network to a php file in a publicly hosted apacher web server? if yes please give me some sample code and guideline for both the voicexml and php. The php file sould send the data to amysql server. I have hosted the php file and created the mysql database. voxeo, pls can one use submit command in your network? for months i have been trying to use submit command on your network but it keep giving me this error. i thought a submit command should be able to execute a valid url. This url is valid, because i can access when entered through an internet browser, but in voicexml hosted in voxeo network, it give the above message. pls help. everyone pls. partial code ============= vxml code ============ . . <submit next="http://www.autosp.byethost13.com/p1.php" method="POST" namelist="username password"/> php code ======== .. |
|
voxeo_chris
|
|
| Hello,
This typically refers to a XML parse error in the document. Whenever you perform a submit in VoiceXML, it actually transitions to the document and the VoiceXML browser attempts to parse it. Make sure that when your document performs the submit, that the only data returned is valid VoiceXML. Any other data in there will definitely cause a parse error. Regards, Chris |
|
azeta_ambrose
|
|
| Hello
Thanks for the response. Would you kindly place some sample code to demonstrate valid VoiceXML data that can be passed from vxml to php and vice visa. Azeta |
|
voxeojeremyr
|
|
| Hi,
We have some good examples of passing variables to and from different server side scripting languages in our tutorial documentation at this URL: http://docs.voxeo.com/voicexml/2.0/qs_vars.htm Thanks, Jeremy Richmond Voxeo Support |
|
wilhelm
|
|
| Hi,
I have a quick question when using submit, I am using the submit variable to connect to a different server. I was wondering is there any way in which I can catch if the server has not responded, down or something like that. While I am writing here I have another question with the submit tag, in playing with the voxeo developers I was able to put a condition on the response of the external site but I have not been able to find out any documentation on how to do this, could you please give me a place to look. Regards Wilhelm |
|
voxeojohnq
|
|
| Hello,
In order to catch a badfetch event, all you need to do is add a <catch event="error.badfetch"> section. When a submit does not successfully fetch a document, execution will move into the <catch> section where you will be able to handle the exception. For example: <?xml version="1.0" encoding="UTF-8"?> <vxml version="2.1"> <form id="frm_main"> <block> <!-- submit to a bad document --> <submit next="badxmldoc.xml" /> </block> </form> <catch event="error.badfetch"> <!-- Execution moves here after the submit fails --> <log expr="'***** BAD FETCH '" /> </catch> </vxml> I'm not exactly sure what you are asking in your second question. If you are asking how to send variables to the remote server, you would use the "namelist" attribute which accepts a space-delimited list of valid variables. I hope this helps, if you have any further questions, please don't hesitate to ask. Regards, John Quinn Voxeo Support |
|
wilhelm
|
|
| Thank you, that does help, I am going to go and read the catch documentation right now. What i was really asking with my second question was can one use the result from a submit to determine the next step in the document ie.
if submit > 10 goto greatTen else goto lessTen If that makes any sense. Regards Wilhelm |
|
voxeoJeffK
|
|
| Hi,
With a <submit> you're are transitioning to a new document altogether. The only way you stay in the current document is if there is an error, as John showed above. If you want to have a logic flow you can either <submit> to a server-side language that will output appropriate VXML based on the namelist variables submitted, or if you want to stay with static pages you can use logic in your VXML document to decide which new page to <submit> to. Hope that helps, Jeff K. |
|
Vijeth
|
|
| Hi, I had struck here. I'm using a VXML file to take the number from user as dtmf input. then i'll transfer that number using <submit>. There i'll check the inputted number with an given number, if the number is incorrect then i've to prompt INVALID NUMBER and have to transfer control to previous vxml file.
this is my vxml file. ---------------------------------------------------------------------- <vxml xmlns="http://www.w3.org/2001/vxml" xml:lang="en-IN" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/vxml http://www.w3.org/TR/voicexml20/vxml.xsd" version="2.0"> <form> <field name="cell" type="digits"> <prompt> Enter your number to check the balance</prompt> <noinput><reprompt/></noinput> <nomatch><reprompt/></nomatch> <filled> <submit next="http://localhost:8080/NewEx1/bal1" namelist="cell"/> </filled> </field> </form> </vxml> --------------------------------------------------------------------- This is my Servlet file import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class bal1 extends HttpServlet{ public void doGet(HttpServletRequest request,HttpServletResponse response)throws IOException,ServletException { PrintWriter out=response.getWriter(); String s=request.getParameter("cell"); int num=1234567890; int input=Integer.parseInt(s); int balance=1234; RequestDispatcher rd=request.getRequestDispatcher("/balance.vxml"); if(num==input) {out.println("<vxml xmlns=\"http://www.w3.org/2001/vxml\" xml:lang=\"en-IN\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \t xsi:schemaLocation=\"http://www.w3.org/2001/vxml http://www.w3.org/TR/voicexml20/vxml.xsd\" version=\"2.0\">" + " <meta name=\"maintainer\" content=\"YOUREMAILADDRESS@HERE.com\"/> <form><block><prompt> your balnce is "+balance+"</prompt></block></form></vxml>"); } else {out.println("<vxml xmlns=\"http://www.w3.org/2001/vxml\" xml:lang=\"en-IN\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \t xsi:schemaLocation=\"http://www.w3.org/2001/vxml http://www.w3.org/TR/voicexml20/vxml.xsd\" version=\"2.0\">" + " <meta name=\"maintainer\" content=\"YOUREMAILADDRESS@HERE.com\"/> <form><block><prompt>invalid number</prompt></block></form></vxml>"); } } } --------------------------------------------------------------------- But when i enter any other number like "1234#", the transfer going bak to vxml file with prompting INVALD NUMBER. Is compiler overlooking the out.println()? Please help me out. |
|
Vijeth
|
|
| Sorry previous code needed another forward statement. Please help me.
Hi, I had struck here. I'm using a VXML file to take the number from user as dtmf input. then i'll transfer that number using <submit>. There i'll check the inputted number with an given number, if the number is incorrect then i've to prompt INVALID NUMBER and have to transfer control to previous vxml file. this is my vxml file. ---------------------------------------------------------------------- <vxml xmlns="http://www.w3.org/2001/vxml" xml:lang="en-IN" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/vxml http://www.w3.org/TR/voicexml20/vxml.xsd" version="2.0"> <form> <field name="cell" type="digits"> <prompt> Enter your number to check the balance</prompt> <noinput><reprompt/></noinput> <nomatch><reprompt/></nomatch> <filled> <submit next="http://localhost:8080/NewEx1/bal1" namelist="cell"/> </filled> </field> </form> </vxml> --------------------------------------------------------------------- This is my Servlet file import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class bal1 extends HttpServlet{ public void doGet(HttpServletRequest request,HttpServletResponse response)throws IOException,ServletException { PrintWriter out=response.getWriter(); String s=request.getParameter("cell"); int num=1234567890; int input=Integer.parseInt(s); int balance=1234; RequestDispatcher rd=request.getRequestDispatcher("/balance.vxml"); if(num==input) {out.println("<vxml xmlns=\"http://www.w3.org/2001/vxml\" xml:lang=\"en-IN\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \t xsi:schemaLocation=\"http://www.w3.org/2001/vxml http://www.w3.org/TR/voicexml20/vxml.xsd\" version=\"2.0\">" + " <meta name=\"maintainer\" content=\"YOUREMAILADDRESS@HERE.com\"/> <form><block><prompt> your balnce is "+balance+"</prompt></block></form></vxml>"); } else {out.println("<vxml xmlns=\"http://www.w3.org/2001/vxml\" xml:lang=\"en-IN\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \t xsi:schemaLocation=\"http://www.w3.org/2001/vxml http://www.w3.org/TR/voicexml20/vxml.xsd\" version=\"2.0\">" + " <meta name=\"maintainer\" content=\"YOUREMAILADDRESS@HERE.com\"/> <form><block><prompt>invalid number</prompt></block></form></vxml>"); rd.forward(request,response); } } } --------------------------------------------------------------------- But when i enter any other number like "1234#", the transfer going bak to vxml file with prompting INVALD NUMBER. Is compiler overlooking the out.println()? Please help me out. |
|
voxeoJeffK
|
|
| Hi,
While debugging Java is definitely outside the scope of this forum I did notice something. In your assignments you have: String s=request.getParameter("cell"); int num=1234567890; int input=Integer.parseInt(s); int balance=1234; and in your test you have: if(num==input) so unless you enter 1234567890 it is always going to hit the "else" block, and return INVALD NUMBER. hope that helps, Jeff K. |
|
Vijeth
|
|
| It helped.Thank you Jeff K | |
Vijeth
|
|
| Hi,
How can i send a variable value in one form to another form? And how to get it in other form? Eg: there is variable select=1234 in form(id=n) i want to use this variable in another form(id=m). how can i? Remember select is an inputted value in form(id=n) |
|
voxeoJeffK
|
|
| Hi,
A variable is in Dialog scope when declared within a form. You will need to assign to the higher Document scope to transfer that value between forms. <var name="highVar"/> <form id="one"> ... <assign name="highVar" expr="localVar"/> <goto next="#two"/> </form> hope that helps, Jeff K. |
|
Vijeth
|
|
| Thank you Jeff, I cleared that.
Again another problem... Can i transfer the control from a file(servlet or vxml) to a a particular form in a particular vxml file?? |
|
Vijeth
|
|
| Thank you Jeff, I cleared that.
Again another problem... Can i transfer the control from a file(servlet or vxml) to a a particular form in a particular vxml file?? |
|
VoxeoDustin
|
|
| Hey Vijeth,
You can, in fact, transfer directly to a form with the submit and goto elements like so: <submit next="AnotherDocument.vxml#AnotherForm"> <goto next="AnotherDocument.vxml#AnotherForm"> Cheers, Dustin |
|
Vijeth
|
|
| Thank you Dustin.... This helped me a lot.... | |
Vijeth
|
|
| Hi, I want to send a variable from one vxml doc to another vxml, for this i can use
<submit next="next.vxml" namelist="myVar"/>. I want use this myVar value.How can i assign it's value to a variable anotherVar in next.vxml???? |
|
voxeoJeffK
|
|
| Hi,
Variables included under namelist in <submit> are passed as query-string parameters which are not available to a vxml document. Usually variables passed this way are processed with server-side language, or are accessed via ccxml and passed to a vxml dialog. What you can do is utilize application scoped variables that are accessible from all leaf vxml documents. In the root vxml document you declare the variable in the standard fashion: <var name="ApplicationVar" expr="'application'"/> and then in leaf documents you prepend "application" to the variable name to reference it: <value expr="application.ApplicationVar"/> hope that helps, Jeff K. |
|
Vijeth
|
|
| Hi Jeff,
Thank you for your time and help. You are helping me a lot. Thank you. |
| login |