| VoiceXML 2.1 Development Guide | Home | Frameset Home |
| cond | Data Type: CDATA | Default: Optional (true) |
| The cond attribute specifies a Boolean expression, which must equate to ‘true’ in order for the content to be visited and executed. (Additionally, the expr attribute must also be set to ‘undefined’, see below). | ||
| 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 specifies the initial value of the element; if this value is ‘undefined’, (default), then the element will be visited by the FIA and executed. If this attribute has a value other than ‘undefined’, then the element will not be visited until explicitly set to 'undefined', by use of the clear element. | ||
| 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 |
| 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. See Appendix C for further information. | ||
| 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’. | ||
| name | Data Type: NMTOKEN | Default: Optional |
| The name attribute specifies the form item ECMAScript variable name for the subdialog in question. | ||
| namelist | Data Type: NMTOKEN | Default: Optional |
| The namelist attribute specifies a space-separated list of variables to send from the invoking application to the subdialog. | ||
| src | Data Type: URI | Default: Optional |
| The src attribute specifies the URI location of the external subdialog file. | ||
| srcexpr | Data Type: CDATA | Default: Optional |
| The srcexpr attribute allows the developer to use an ECMAScript expression to specify the target URI of the subdialog. Of note is the fact that either src or srcexpr may be used within a subdialog, but not both. | ||
| <?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"> <var name="confirm_prompt"/> <var name="response"/> <field name="field_confirm" type="boolean"> <prompt> <value expr="confirm_prompt"/> </prompt> <filled> <if cond="field_confirm == true"> <assign name="response" expr="'yes'"/> <else/> <assign name="response" expr="'no'"/> </if> <return namelist="response"/> </filled> </field> </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"> <subdialog name="SubD_1" src="MySubD.vxml" cond="false"> <param name="confirm_prompt" expr="'since the condition is set to false, this will not be executed'"/> </subdialog> <subdialog name="SubD_2" src="MySubD.vxml" expr="crusty"> <param name="confirm_prompt" expr="'since the expression is not set to undefined, this will not be executed'"/> </subdialog> <subdialog name="SubD_3" src="MySubD.vxml" cond="true" expr=""> <param name="confirm_prompt" expr="'this subdialog will be executed, since the condition is true, and the expression is undefined. Say yes or no to execute the subdialog file.'"/> <filled> <prompt> poppa oo mow mow! </prompt> </filled> </subdialog> </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"> <subdialog name="SubD_1" src="MySubD.vxml" fetchhint="prefetch" fetchtimeout="25s"> <param name="confirm_prompt" expr="'truthfully. were you happy to see Lance Bass get kicked off the Russian orbiter mission?'"/> <filled> <prompt> you didnt fool me for a second. </prompt> </filled> </subdialog> </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> <prompt> preparing to hit the sub dialog. </prompt> </block> <subdialog name="SubD_1" src="MySubD.vxml" fetchaudio="MySoundFile.wav"> <param name="confirm_prompt" expr="'is beatrice arthur getting better looking with age?'"/> <filled> <prompt> yeah, okay. whatever you say. </prompt> </filled> </subdialog> </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"> <field name="F_1"> <grammar type="text/gsl">[hozee cow]</grammar> <prompt> what is the best lawn care tool ever devised? </prompt> </field> <subdialog name="SubD_1" src="MySubD_2.cfm" namelist="F_1"> <filled> <prompt> if you say so. </prompt> </filled> </subdialog> </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"> <var name="MyTarget" expr="'MySubD_2.cfm'"/> <field name="F_1"> <grammar type="text/gsl">[hozee cow]</grammar> <prompt> what is the best lawn care tool ever devised? </prompt> </field> <subdialog name="SubD_2" srcexpr="MyTarget" maxage="5000" maxstale="4000"> <filled> <prompt> if you say so. </prompt> </filled> </subdialog> </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"> <var name="response"/> <var name="F_1" expr="'hozee cow'"/> <field name="field_confirm" type="boolean"> <prompt> did you say <value expr="F_1"/> ? </prompt> <filled> <if cond="field_confirm == true"> <assign name="response" expr="'yes'"/> <else/> <assign name="response" expr="'no'"/> </if> <return namelist="response F_1"/> </filled> </field> </form> </vxml> |
| ANNOTATIONS: EXISTING POSTS |
Asier
|
|
| Hello,
Can you receive more than one variable from a subdialog?? Thanks in advance. |
|
Asier
|
|
| Yes, with de return element and de attribute namelist.
Sorry. |
|
Asier
|
|
| Hello!!
My question is if i have this call <subdialog name="prueba" src="http://192.168.1.99/pruebasxml/prueba1.php"/> i know receive values from de same document, the variables to treated in the subdialog tag you have to accede accros "prueba.VARIABLE" but i'm not sure if the document it is in the web server the treat is same. If is different how i can to accede to variables contained in the php document. Sorry for my english. Thanks in advance. |
|
MattHenry
|
|
| Hello Asier,
I'm not entirely sure what it is that you are asking here. In all honesty, I think that this subject might be better suited for an account ticket. If you are asking "how can I access PHP variables within the subdialog", then you would need to do one of two things: (1) declare your PHP variables as session variables, which will make them accessible thoughout the application. (2) Import the PHP variables into the VXML context, and pass them along to the subdialog via the <param> tag. Regards, ~Mateo Enrique |
|
bpcamac
|
|
MattHenry
|
|
|
Hi there, Was there a subdialog question for us here? Don't want to leave anyone hanging, or anything... =^) ~Matt |
|
bpcamac
|
|
| I did post a question, but it seems to have not made it in.
At any rate, I've found the answer. Thx. |
|
SSA_MarkPMiller
|
|
| Mat,
When using a subdialog that is set as enctype="multipart/form-data", how do you pass information other than the file upload data in the name list. As an example, I've let the user record a message and now I want to send it to the PHP processing script. The namelist is holding the binary data (theReport) and the temporary file name (pin_number). Since the use of $_FILES is an associative array related back to the binary file info, how am I going to hold state? I can't pass a session variable back and forth to keep track of who this recording is supposed to be associated with. VXML SCRIPT SNIPPET: <subdialog name="saveMessage" src="http://MyServer/ProcessRecording.php" method="post" enctype="multipart/form-data" namelist="theReport tmp_name"> <filled /> </subdialog> PHP SCRIPT SNIPPET: $tmpFile=$_FILES['theReport']['tmp_name']; if (is_uploaded_file($tmpFile)) { // save the recording and create unique filename $wavfile= 'recordings/' . session_id() . ".wav"; copy($tmpFile, sprintf("%s",$wavfile)); $fileName = session_id() . '_' . date("YmdHis") . ".wav"; ..... } Thanks, Mark |
|
MattHenry
|
|
|
Hello Mark, To be clear, we don't offer any kind of technical support for PHP-specific, or JSP-specific application issues. Not to sound Draconian, but this sort of support is way outside the scope of what our free developer offerings includes, for reasons that are somewhat obvious. I'm not at all certain that I am fully understanding the exact question that you need an answer on; you can POST VXML variables in the same manner as you would with recorded audio data, (although what you do with these values on the PHP side is certainly going to be carried out in a different manner). I did want to ask what exactly is stopping you from utilizing session variables to keep your state, or even using some session cookies to do so? I'll be glad to offer what help that I can on the subject while staying in the constraints of our support policies, but bear in mind that I am not a PHP developer, so my responses will be in a generalistic sort of vein. ~Matthew Henry |
|
SSA_MarkPMiller
|
|
| Matt said:
"I'm not at all certain that I am fully understanding the exact question that you need an answer on; you can POST VXML variables in the same manner as you would with recorded audio data, (although what you do with these values on the PHP side is certainly going to be carried out in a different manner)." Mark responds: Thanks for your quick response. Agreed, you can POST them through the namelist attribute using the default enctype attribute. However, when using 'enctype="multipart/form-data"' as a subdialog attribute, my understanding is that this forces the namelist items into an array context relative to the binary data being passed in. Am I misunderstanding something? The question is, how do I pass other attributes to the receiving script that are NOT related to the file being passed. I don't think this has anything to do with a specific programming language, I just happen to be using PHP. Mark |
|
MattHenry
|
|
|
Hello Mark, I'm not at all sure where the statement of "this forces the namelist items into an array context relative to the binary data being passed in" comes from at all, and I am failing to grok how this is relative to the question. As I am still having problems understanding, so I am going to do my best to address this in broad a scope as I can. You can catch any and all POSTed querystring data within your catcher script via $_REQUEST, (or $_POST, if you are feeling frisky). Alternately, you can use non-persistent session cookies to keep this data from expiring, (I'm still unclear as to why this isn't an option). If this does not help you address your questions, it might be best if you can simply describe what your end goal is, so that we can hopefully provide some assistance that is a bit more concise. Regards, ~Matthew Henry |
|
mkoe
|
|
| Hi Mark,
How can I use <subdialog> in a <foreach>? It seems the vxml doesn't allow to execute subdialog within <foreach>. I put my sample as the following. Thanks for your help. <form name="main"> <foreach item = "theCurrentSAVAccout" array = "SAVAccoutList"> <subdialog name="result" src="#SayAccountInformation"> <param name="currentMonth" expr="theCurrentSAVAccout.currentMonth" /> <param name="previousYear" expr="theCurrentSAVAccout.previousYear" /> <param name="isJanToMay" expr="theCurrentSAVAccout.isJanToMay" /> <filled /> </subdialog> </foreach> </form> <form name="theCurrentSAVAccout"> <block> </block> </form> When I run the above code in IBM VoiceToolkit, I am getting error --------------------------------------------------------- INFO: Call is connected. ERROR - Cause: VXML Document error: and form the system error log. [7/4/06 11:20:21:250 EDT] 254cc570 VXML E 3006509539553984@127.0.0.1 TRAS0014I: The following exception was logged com.ibm.voice.server.vc.VContainerException: VContainer::dialogRun at com.ibm.voice.server.vc.core.VContainer.dialogRun(VContainer.java:389) at com.ibm.voice.server.vxp.VXPRuntime$RunWorker.runWork(VXPRuntime.java:747) at com.ibm.voice.server.vxp.VXPWorker.run(VXPWorker.java:84) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:912) Caused by: com.ibm.vxi.intp.BrowserProcException: VXIContext::interpret: at com.ibm.vxi.intp.VXIContext.interpret(VXIContext.java:512) at com.ibm.vxi.intp.VoiceBrowser.run(VoiceBrowser.java:570) at com.ibm.voice.server.vc.core.VContainer.dialogRun(VContainer.java:383) ... 3 more Caused by: error.badfetch:com.ibm.vxi.intp.CatchEvent: file:/C:/myViews/snapshots/MKOE_VoiceXML/vxml/ITSWebProject/WebContent/main/vxml/interestEarned.vxml:VXML Document error: Line : 353 Column: 18 URI : null Msg : The content of element type "foreach" must match "(audio|enumerate|value|assign|clear|data|disconnect|exit|goto|if|log|prompt|reprompt|return|script|submit|throw|var|foreach|break|emphasis|mark|phoneme|prosody|say-as|voice|sub|paragraph|p|sentence|s|metadata)". at com.ibm.vxi.intp.VXIContext.parseDocument(VXIContext.java:1568) at com.ibm.vxi.intp.VXIContext.getDocument(VXIContext.java:1200) at com.ibm.vxi.intp.VXIContext.fetchDocument(VXIContext.java:1084) at com.ibm.vxi.intp.VXIContext.interpret(VXIContext.java:327) ... 5 more Caused by: com.ibm.vxi.intp.VXMLParserException: VXML Document error: Line : 353 Column: 18 URI : null Msg : The content of element type "foreach" must match "(audio|enumerate|value|assign|clear|data|disconnect|exit|goto|if|log|prompt|reprompt|return|script|submit|throw|var|foreach|break|emphasis|mark|phoneme|prosody|say-as|voice|sub|paragraph|p|sentence|s|metadata)".org.xml.sax.SAXException: Line : 353 Column: 18 URI : null Msg : The content of element type "foreach" must match "(audio|enumerate|value|assign|clear|data|disconnect|exit|goto|if|log|prompt|reprompt|return|script|submit|throw|var|foreach|break|emphasis|mark|phoneme|prosody|say-as|voice|sub|paragraph|p|sentence|s|metadata)". at com.ibm.vxi.intp.VXMLParser.parse(VXMLParser.java:258) at com.ibm.vxi.intp.VXMLParser.parse(VXMLParser.java:204) at com.ibm.vxi.intp.VXIContext.parseDocument(VXIContext.java:1494) ... 8 more . com.ibm.voice.server.vc.VContainerException: VContainer::dialogRun at com.ibm.voice.server.vc.core.VContainer.dialogRun(VContainer.java:389) at com.ibm.voice.server.vxp.VXPRuntime$RunWorker.runWork(VXPRuntime.java:747) at com.ibm.voice.server.vxp.VXPWorker.run(VXPWorker.java:84) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:912) Caused by: com.ibm.vxi.intp.BrowserProcException: VXIContext::interpret: at com.ibm.vxi.intp.VXIContext.interpret(VXIContext.java:512) at com.ibm.vxi.intp.VoiceBrowser.run(VoiceBrowser.java:570) at com.ibm.voice.server.vc.core.VContainer.dialogRun(VContainer.java:383) ... 3 more Caused by: error.badfetch:com.ibm.vxi.intp.CatchEvent: file:/C:/myViews/snapshots/MKOE_VoiceXML/vxml/ITSWebProject/WebContent/main/vxml/interestEarned.vxml:VXML Document error: Line : 353 Column: 18 URI : null Msg : The content of element type "foreach" must match "(audio|enumerate|value|assign|clear|data|disconnect|exit|goto|if|log|prompt|reprompt|return|script|submit|throw|var|foreach|break|emphasis|mark|phoneme|prosody|say-as|voice|sub|paragraph|p|sentence|s|metadata)". at com.ibm.vxi.intp.VXIContext.parseDocument(VXIContext.java:1568) at com.ibm.vxi.intp.VXIContext.getDocument(VXIContext.java:1200) at com.ibm.vxi.intp.VXIContext.fetchDocument(VXIContext.java:1084) at com.ibm.vxi.intp.VXIContext.interpret(VXIContext.java:327) ... 5 more Caused by: com.ibm.vxi.intp.VXMLParserException: VXML Document error: Line : 353 Column: 18 URI : null Msg : The content of element type "foreach" must match "(audio|enumerate|value|assign|clear|data|disconnect|exit|goto|if|log|prompt|reprompt|return|script|submit|throw|var|foreach|break|emphasis|mark|phoneme|prosody|say-as|voice|sub|paragraph|p|sentence|s|metadata)".org.xml.sax.SAXException: Line : 353 Column: 18 URI : null Msg : The content of element type "foreach" must match "(audio|enumerate|value|assign|clear|data|disconnect|exit|goto|if|log|prompt|reprompt|return|script|submit|throw|var|foreach|break|emphasis|mark|phoneme|prosody|say-as|voice|sub|paragraph|p|sentence|s|metadata)". at com.ibm.vxi.intp.VXMLParser.parse(VXMLParser.java:258) at com.ibm.vxi.intp.VXMLParser.parse(VXMLParser.java:204) at com.ibm.vxi.intp.VXIContext.parseDocument(VXIContext.java:1494) ... 8 more [7/4/06 11:20:21:266 EDT] 28630570 CCM A 3006509539553984@127.0.0.1 Processed event:error.dialog.notstarted state:dialog.started |
|
MattHenry
|
|
|
Hello there, I think that there is a bit of confusion that I should clear up. Checking the parent-child listing for theelements in question, <subdialog> is not a valid child of <foreach>, so this is not a valid option. You could however, code a foreach loop on the serverside, and output your subdialogs as needed. ~Matt |
|
jesusla
|
|
| Hi,
I am running a Prophecy Voice Browser with Nuance OSR. Under certain circumstances, I am experiencing unexpected periods of silence when calling a subdialog. Here is the scenario: Suppose I have a form which plays a prompt and then invokes a subdialog that in turn plays a prompt too. The expected behavior should be: - Prompt is played - Subdialog prompt is played. Instead I get: - Prompt is played - Several seconds of silence. - Subdialog prompt is played. After looking at the Voxeo logs, I notice that the Voice Browser executes a recognition at that very moment the pause takes place. This recognition eventually ends after throwing a no-input-timeout event. Which is pretty odd, since I'm not executing any recognition. Here is the smallest vxml file that can reproduce this behavior: bug.xml ------- <?xml version="1.0"?> <vxml version="2.1"> <link dtmf="1" event="noinput"/> <property name="timeout" value="7s"/> <form> <subdialog src="bug.xml#sub" maxage="0"> <prompt>About to call sub-dialog.</prompt> </subdialog> </form> <form id="sub"> <block> In sub-dialog. </block> </form> </vxml> ----------------------- It seems that the following has to be true for the bug to happen: - A link must be defined - The timeout property must be specified - A subdialog must be called on a separate file (or alternatively, on the same file after reloading it) The experienced silence is exactly the same as the value of the "timeout" property. Which confirms what I saw in the log. Please note that this is a simplified case. I'm experiencing this problem with forms and subdialogs that actually perform complicated tasks (involving recognitions) Thanks, -Jesus |
|
mikethompson
|
|
| Hi Jesus,
This is a good find! I'll need to run through this test tomorrow with my platform engineers. Once I have more information for you on this possible bug, I will let you know. Best, Mike Thompson Voxeo Corporation |
|
mikethompson
|
|
| Hi Jesus,
After further testing, I noticed this is an issue specific to Prophecy, not our VoiceCenter 5.5 Hosted Environment (Motorola VXML browser). That being said, I opened an internal bug ticket with engineering to get this fixed in one of the future builds of Prophecy. Unfortunately, I do not have an ETA of a fix for this, but I can tell you it is on engineering's plate. Should you wish to check up on this bug in the future just reference bug ticket #171375. Best, Mike Thompson Voxeo Corporation |
|
karthiga
|
|
| Hi Matthew,
I need your help to know the information about VXML certification. I am going through the vxml.org guide and W3C VXML 2.0. I want to know about the Exam pattern i.e how many questions will be there in the exam and some free mockup exams on vxml. If you guide me then it will be very helpful for me. Thanks, Karthiga |
|
sidvoxeo
|
|
| Hi there,
The best place to find information is to have a look at the following URL : http://www.voicexml.org/certification/developer.html Mock up exams and CD's for the test can be bought from the following website: http://www.vxmlguide.com/ Go to the order tab and select the CD's to be bought. Let us know if you have any other questions. Thanks Sid |
|
karthiga
|
|
| Hi Sid,
Thanks for your reply. Now I am going through vxmlguide also. sid, I want to know how many questions will be there in the Exam and pass percentage for the Exam. I am expecting the clear picture about the Exam. Thanks, Karthiga |
|
sidvoxeo
|
|
| Kartiga,
We at Voxeo do not have any authority on the VoiceXML testing. I am not sure the number of questions asked or the pattern of questions. You may want to shoot an email to the VoiceXML forum guide or the Prometric Testing Centers to get more information. Thanks Sid |
|
shawnaslam1
|
|
| hello Matthew,
I am not able to find the answer of my question from the described examples and discussion.My question is: When i call the Subdialog which will lead me to my destination place now in the destination place i write the return with the variable lets say C1 in the namelist.Now i get the control back in the originated form but now how can i access the variable value C1 which sent by the target place.Let me know if you need sample code for clarification. Regards, Shawn Aslam |
|
VoxeoDustin
|
|
| Hey Shawn,
All variables specified in the namelist attribute of the return element in a subdialog are available as an ECMAScript object that is the name of the subdialog. So for example, if our subdialog call looks like this: <subdialog name="mySubDialog" ...> and our return looks like this: <return namelist="C1 C2"/> We can grab the values of any variables returned like so: <assign name="C1" expr="mySubDialog.C1"/> <assign name="C2" expr="mySubDialog.C2"/> Hope this helps, Dustin |
|
shawnaslam1
|
|
| Yes it really helps Dustin.Thanks | |
jefo12
|
|
| plz giv me a simple example on appointment scheduling...
|
|
voxeojeremyr
|
|
| Hi jefo12,
While we don't have specific examples of an appointment scheduling application, our tutorial is a good place to start learning how you can do this. Here is a link to the start of our VXML tutorial: http://docs.voxeo.com/voicexml/2.0/learningvoicexml.htm If during your development you have specific questions or issues that come up, we would be more than happy to assist you. Thanks, Jeremy Richmond Voxeo Support |
|
jefo12
|
|
|
main.vxml <vxml> <form id="F1"> <subdialog name="sub_d1" src="mypage.jsp" namelist="callerid"> </form> <form id="F2"> </vxml> i want to submit a "callerid" to a jsp and from there i wanna go to a database to check whether that callerid had any appointments or not. if there store that in a variable and return back to the subdialog.if i write return var; in jsp will it come and store in the namelist var of subdialog or not. 2)if i want to return an array where they hav to be return . 3)can i write vxml inside a jsp? plz give me suggestions... mypage.jsp 1)Retrieve appointments from the data base.. String phNo = request.getParameter("callerid"); If(phNo is not valid){ Using vxml tag goto the form #F2 } else{ //Make a database query and get the result in the form of a string array. String appointments[] = {'dummy1', 'dummy2'};(values retrieved from database); HOW TO RETURN THESE VALUES TO MAIN.VXML AND HOW TO RECEIVE THERE.. } |
|
voxeojohnq
|
|
| Hello,
Please keep in mind that we do not create, debug or support server side programming. With that said, you seem to be struggling with your initial design for your appointment application. Now, I can't write your entire application for you, but I am more than happy to provide you with a starting point for creating your application. Please keep in mind that the following code is not a complete application, and it only resembles a basic framework that you can use to help you with your design process. What you are trying to do will most likely be a lot easier if you create a ccxml wrapper. The basic concept is use ccxml to accept calls and control the voicexml dialogs. I wrote up a quick example of how you could create your call flow. Here is how it works: - Use ccxml to accept the call - set a variable to the incoming caller id - start a voice xml document - vxml will fetch the db script and send the callerid to it - the db script will then return a well-formed xml document with an element called <accepted> which will be a boolean (true/false) - now we send execution back to the ccxml wrapper - the ccxml wrapper will then decide what to do with the user based on the true/false sent from vxml ================================================= CCXML Example ================================================= <?xml version="1.0" encoding="UTF-8" ?> <ccxml version="1.0" xmlns="http://www.w3.org/2002/09/ccxml" xmlns:voxeo="http://community.voxeo.com/xmlns/ccxml"> <var name="callerid" /> <var name="state" /> <var name="cid" /> <eventprocessor statevariable="state"> <transition event="connection.alerting"> <!-- accept the call --> <accept /> </transition> <transition event="connection.connected"> <!-- This is the caller id --> <assign name="callerid" expr="event$.connection.remote" /> <assign name="cid" expr="event$.connectionid" /> <send name="'query_db'" target="session.id" /> </transition> <transition event="query_db"> <assign name="state" expr="'in_query'" /> <!-- send the user top the vxml doc to query the db --> <dialogstart src="'checkdb.vxml.xml'" type="'application/voicexml+xml'" namelist="callerid" connectionid="cid" /> </transition> <transition event="dialog.exit" state="query_db"> <!-- YAY you have something --> <log expr="'***' + event$.values.accepted /> <exit /> </transition> <transition event="error.*"> <exit /> </transition> </eventprocessor> </ccxml> ================================================= VXML Example ================================================= <?xml version="1.0" encoding="UTF-8"?> <vxml version="2.1"> <!-- Set the local caller id var to the one sent from the wrapper --> <var name="callerid" expr="session.connection.ccxml.values.callerid" /> <form id="frm_check"> <block> <assign name="document.callerid2" expr="callerid" /> <var name="query_data" /> <!-- use the data element to query the db and get a well-formed xml doc back --> <data name="query_data" src="http://yourscript.thingie" namelist="callerid2" method="get" /> <assign name="document.query_data" expr="query_data.documentElement" /> <script> <![CDATA[ function get_data( data, tag ) { return( data.getElementsByTagName( tag ).item( 0 ).firstChild.data ); } ]]> </script> <!-- get the accepted element --> <var name="accepted" expr="get_data( query_data, 'accepted' )" /> <log expr="'*** ' + accepted" /> <if cond="accepted == 'true'"> <exit namelist="accepted" /> <else /> <block> <prompt>Authentication Failed</prompt> </block> <break time="'4000ms'" /> <assign name="accepted" expr="false" /> <exit namelist="accepted" /> </if> </block> </form> </vxml> I hope this helps you get started with your application. If you have any other questions, please don't hesitate to ask. Regards, John Quinn Voxeo Support |
|
jefo12
|
|
| hi john quinn thank you for your response bt i have a small problem i could'nt understand the <script> in the callerid validation code given by you...can you plz giv me a brieff discription abt that...
<script> <![CDATA[ function get_data( data, tag ) { return( data.getElementsByTagName( tag ).item( 0 ).firstChild.data ); } ]]> </script> |
|
MattHenry
|
|
|
Hi Jefo, This is client-side DOM code that is used for getting node data out of a plain XML document. Some helpful links on this topic are listed as follows: http://docs.voxeo.com/voicexml/2.0/data.htm http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113/traversal.html http://www.devguru.com/Technologies/ecmascript/quickref/javascript_index.html ~Matt |
|
mtatum111
|
|
| Can <subdialog> also be a child of <subdialog> meaning that you can have nested subdialog calls? I noticed that the only parent listed is <form>. I couldn't find anything on w3c specifying that this is a "no no." So, I am wondering if you can have nesting like you have in other languages.
Thanks for any clarification. |
|
VoxeoDustin
|
|
| Hey,
<subdialog> is not a valid child of itself, however it is possible to call another subdialog from within a subdialog. This does add another layer of complexity into your application, and we highly recommend avoiding subdialogs entirely unless they are absolutely necessary for your application. Cheers, Dustin |
|
mtatum111
|
|
| Hi Dustin, can you give an example of this. I am a little confused. I understand that <form> is the only valid parent of <subdialog>. However, if you can call a <subdialog> element from within a <subdialog> element within a <subdialog> it seems that a <subdialog> would be the parent.
Here is the exact question that I was presented A <subdialog> can contain a <subdialog> element. I just don't understand this if <form> is the parent of a <subdialog>. Am I missing something here? Sorry to be a pain! |
|
mtatum436
|
|
| I went back to the vxml 2.0 specification and read about <subdialog>. I think I understand now. My confusion was with the subdialog vs. the <subdialog> element. The way that I understand it is that subdialog is just an section of code that include another form. Whereas the <subdialog> is used to call this section of code. Do you agree with what I am saying?
|
|
voxeoJohn
|
|
| Hi,
Our developers questions are never bothersome, how dare you suggest such a thing =)>. That is correct the [b]<subdialog>[/b] element is where the parent/child hierarchy comes into play. I have a link here to the SubDialog Tutorial that I think may clear a few things up for you: http://docs.voxeo.com/voicexml/2.0/t_12.htm If this just brings more questions please feel free keep posting! We are always happy to offer any assistance our developers may need!! Regards, John Customer Engineer |
|
jefo12
|
|
| Hi,
Is there any way to decrease the fetching time of a jsp. In my case i'm sending a request to a jsp,the jsp has to hit the google calender and get the results.But this take minimum 2 minutes can any one tell me is there any way to reduce the fetching time. Hope i'll have a favourable reply. Thanks, Jefo. |
|
voxeoJeffK
|
|
| Hi,
There are many factors to take into account on fetch times. First would be the target destination, in this case Google. We cannot make them go faster. Next to consider is the environment in which you are running your application. If you are in the Staging environment fetch times may be increased since it is a shared, development environment. The Production environment, or a Premise based server would be somewhat faster. hope that helps, Jeff K. |
|
mtatum111
|
|
| If you are in a <subdialog> and you encounter an error and you do NOT have a <catch> element defined within the <subdialog>, then where do we go to "catch" the error. I am thinking that we go to the application root. Thanks for any clarification. | |
MattHenry
|
|
|
Hi there, Assuming that your subdialog has a root document all to itself, then the answer is "yes". Note that subdialogs do *not* share the application root of the document chain that invokes the subdialog itself; a new application root must be declared for any subdialog invocations that occur. See the below w3c links for additional details: * http://www.w3.org/TR/voicexml20/#dml2.3.4 * http://www.w3.org/TR/voicexml20/#dml1.5.2 ~Matt |
|
mtatum111
|
|
| I have found the following example, but believe that there might be a problem with it. It was my understanding that <subdialog> is a child of <form> only. See <subdialog name="centigrade" src="#fahrenheit_to_centigrade"> below.
In this case, it is a child of <filled>. Is that correct? <form id="conversion"> <field name="fahrenheit"> <grammar version = "1.0" type= "application/grammar+xml" src = "temperature.grxml"/> <prompt>What is the temperature in fahrenheit degrees? </prompt> <filled> <subdialog name="centigrade" src="#fahrenheit_to_centigrade"> <param name = "parm1" expr = "fahrenheit" /> </subdialog> </filled> </field> </form> |
|
VoxeoDustin
|
|
| Hey Melissa,
Correct. Subdialog is only a valid child of <form>, so in this case the content of the subdialog tag will simply be skipped over by the VoiceXML browser. The best way to achieve the same functionality is to utilize the name attribute of subdialog and issue a <goto nextitem="#mySubDName"/> within the filled. Cheers, Dustin |
|
mtatum111
|
|
| Thanks, for clarifying this Dustin. I am just trying to study for my certification test and want to make sure that I am not studying invalid operations! | |
VoxeoDustin
|
|
| Hey Melissa,
No problem. I've been there before, so I'm glad to answer any questions you may have regarding the certification test. :) Regards, Dustin |
|
mtatum111
|
|
| I see that with <subdialog> you can have the namelist attribute.
Can you explain the difference between this and the <param> attribute where you can send variables to <subdialog> or <object>? It seems that with namelist, you are also able to send values. Thanks for any explanation. |
|
voxeojeremyr
|
|
| Hi Melissa,
Researching the specification, passing variables to a subdialog form can be done noth by an attribute of subdialog, 'namelist', and through the param element. The only difference that I can see is that with the <param> element you can set a value to the variable that you are passing, while using namelist, the variable already has to be defined and populated. Regards, Jeremy Richmond Voxeo Support |
|
mtatum111
|
|
| Thanks, Jeremy. I appreciate the insight! |
| login |