| VoiceXML 2.1 Development Guide | Home | Frameset Home |
| 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. | ||
| expritem | Data Type: CDATA | Default: Optional |
| The expritem attribute denotes an ECMAScript value that equates to the value of the next form item, (such as a field name) to visit. Either expritem or nextitem may be specified, 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: safe |
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 *not* prefetch content by default. As such, a developer should specify a value of ''prefetch" if resources are to be made available prior to execution of application content. | ||
| fetchtimeout | Data Type: CDATA | Default: 5s |
| The fetchtimeout attribute allows the developer to specify how much time to allow on a fetch before throwing an error.badfetch event. This can be specified globally by using the fetchtimeout property in the application root document. If not specified, it will default to 5 seconds. Also note the strict formatting of this value; if specified, the time value must have the ‘s’ denomination appended to it, else an error.badfetch is thrown: <goto next="MyPage.vxml” fetchtimeout=”5s”/> | ||
| 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. | ||
| 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: <goto next=”http://MyServer.com/MyFile.vxml”/> or a relative URI: <goto 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: <goto next=”#AnotherForm”/> Or lastly, it can indicate a specific form in another document: <goto next=”AnotherDocument.vxml#AnotherForm”/> | ||
| nextitem | Data Type: NMTOKEN | Default: Optional |
| The nextitem attribute works much like the next attribute, except that it allows the developer to transition the caller to a specific form item within the current document, for example: <goto nextitem="fieldName"/> | ||
| <?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"/>/> <var name="MyGotoVar" expr="'MyNextPage.vxml'"/> <form id="F1"> <block> <prompt> preparing to go to another document. </prompt> <goto expr="MyGotoVar" fetchaudio="MySoundFile.wav"/> </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"/> <var name="GotoVar" expr="'B_4'"/> <form id="F1"> <block name="B_1"> <prompt> preparing to go to the next form item. </prompt> <goto nextitem="B_2"/> </block> <block name="B_2"> <prompt> preparing to go to the next form item variable. </prompt> <goto expritem="GotoVar"/> </block> <block name="B_3"> <prompt> this block will be skipped, and will be the last block executed by the FIA.</prompt> </block> <block name="B_4"> <prompt> test successful.</prompt> </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 name="B_1"> <prompt> preparing to go to another page. </prompt> <goto next="AnotherPage.vxml" fetchhint="prefetch" fetchtimeout="10s"/> </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 name="B_1"> <prompt> preparing to go to another page. </prompt> <goto next="AnotherPage.vxml" maxage="5000" maxstale="5000" fetchtimeout="10s"/> </block> </form> </vxml> |
| ANNOTATIONS: EXISTING POSTS |
yana
|
|
| Hi,
I have the built-in grammar with number of promts. What way to goto next one if the catch event 404. This is example: ... <field name="input" type="digits?minlength=1;maxlength=6"> <prompt bargein="false"> <audio src="one.wav"/> </prompt> <catch event="error.badfetch.http.404"> <goto nextitem=?????? > </catch> <prompt bargein="true"> <audio src="two.wav"/> </prompt> ... I should to play prompt 'two.wav' anywhere. If this is not grammar case, I use the block element and jump to anothe one. But into grammar I couldn't use it. Thanks, Yana |
|
MattHenry
|
|
|
Hello Yana, I'm not totally sure that I am understanding all your questions. To address the frst, I'd think that the following would work: <field name="input" type="digits?minlength=1;maxlength=6"> <prompt bargein="false"> <audio src="one.wav"/> </prompt> <catch event="error.badfetch.http.404"> <assign name="input" expr="'skipMe'" <goto nextitem="twoBlock"> </catch> </field> <block name="twoBlock"> <prompt bargein="true"> <audio src="two.wav"/> </prompt> </block> Note that the block is outside the field scope, and that we have also set the field var to a value, meaning that it can't be revisitied. Regards, ~Matthew henry |
|
yana
|
|
| Hello,
This solution doesn't help becouse the next wave is out of the field grammar and I need to collect all digits pressed during both of prompts and pass them together. Thanks, Yana |
|
MattHenry
|
|
|
Yana, I am still not totally sure that I am understanding what you are asking, but I will do my best to provide you with a solution based on how I am interpreting your last comment. If you are looking to play the second prompt in the event that you encounter a 404 error, while within the context of the same form item, then you may try something like this: <vxml> <var name="P2" expr="'false'"/> <form> <field name="input" type="digits?minlength=1;maxlength=6"> <prompt bargein="false" cond="document.P2== 'false'"> <audio src="one.wav"/> </prompt> <prompt bargein="true" cond="document.P2 =='true'"> <audio src="two.wav"/> </prompt> <catch event="error.badfetch.http.404"> <assign name="document.P2" expr="'true'" /> <goto nextitem="input"/> </catch> </field> </form> Hope this helps, ~Matt |
|
lambchops7
|
|
| Hi,
Say that I have main.vxml and then I <goto> a file named "Question1.vxml" in another directory called "SIBDQ" with the command "<goto next="SIBDQ/Question.vxml"/>. Now I'm in the SIBDQ directory, how do reference one folder up and <goto> a form in the min.vxml file? <goto next="../main.vxml#section">?? Thanks. manny |
|
MattHenry
|
|
|
Manny, That looks correct to me; is this not working for you? ~Matt |
|
iomodo
|
|
| hello.
I have some problems useing goto tag. The following code throws some kind of error. I assume the problem is in the simbol "&". The question is how can I pass two or more atributes? <?xml version="1.0" encoding="UTF-8"?> <vxml version = "2.1" > <form id="smth"> <field name="F0" > <grammar type="text/gsl"> [one two] </grammar> <prompt bargein="true" timeout="1s"> hello. I'm here. </prompt> </field> <filled namelist="F0"> <if cond="F0=='one'"> <goto next="one.jsp?param1=1"/> <elseif cond="F0=='two'"/> <goto next="two.jsp?param1=1¶m2=2"/> </if> </filled> </form> </vxml> Thanks, Iomodo |
|
iomodo
|
|
| hello again. I have solved the problem. I just replaced & -> &
it works now. thanks anyway :) |
|
VoxeoBrian
|
|
| Hello,
Glad to see you were able to resolve the issue by properly escaping the ampersand character. Please let us know if there is anything else we can do to help. Standing by, Brian |
|
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 |
|
tieuvodanh
|
|
| Dear,
How could we goto another field in another form? For example, <form id="1"> <block> <goto f2 (both <goto nextitem = "f2" and <goto next=#2.f2 didn't work <form id="2"> <field name="f1"> <field name="f2"> Thank you very much |
|
voxeoblehn
|
|
| Hello,
As per the spec you cannot <goto> another field from a form. You will only be able to <goto> another form, document, or form within another document. Hope this helps and if we can be of further assistance, please feel free to contact us. Cheers, Brian Lehnen Voxeo Support |
|
jaffar
|
|
| <form id="pickcity"
<field name="city"> <prompt> please select the city do u want. </prompt> <grammar type="text.sgl"> [hyderabad bombay delhi [madras chennai] calcutta] </grammar> <option>hyderabad></option> <option>bombay</option> <option>delhi</option> <option>calcutta</option> <option>chennai</option> <catch event="help nomatch noinput"> your options are <enumerate/> <prompt>you say <value expr="city"/></prompt> <block> <submit next="mypage.jsp" method="post"/> </block> </field> </form> <form id="movies"> <field name="movie"> <block> <goto next="#pickcity"> </block> -------------------------\ In the above vxml application if i want to go from form "movies" to form "cities" using goto and in "cities" i need upto <block> element and i dont want to submit it to the jsp page .... is it possible....? plz giv me suggestion... |
|
voxeojeremyr
|
|
| Hi Jaffar,
I am not sure I understand your question. In the "cities" form you will probably need a filled element so that you can play back to the caller the city that they selected. I don't understand what you mean when you say that you want to go from "movies" to "cities" without doing the submit to the jsp. If you would give us a little more information, we should be able to help you out. Thanks, Jeremy Richmond Voxeo Support |
|
feel012
|
|
| Hi~
I have a question... I want a goto using varible. I thought first that is possible to use double tag.. for example.. <goto next="#<value expr="document.AA"/>"/> but It occured error.. please help me... |
|
voxeoblehn
|
|
| Hello,
If I am understanding you correctly you are looking to assign a document to a variable and then reference it via the <goto> tag? If that is indeed what you are looking to do, you would want to declare your variable and call it like so: I have bolded the relevant code. [code] <?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"/>/> [b]<var name="MyGotoVar" expr="'MyNextPage.vxml'"/>[/b] <form id="F1"> <block> <prompt> preparing to go to another document. </prompt> <goto [b]expr="MyGotoVar"[/b] fetchaudio="MySoundFile.wav"/> </block> </form> </vxml> [/code] I pulled this directly from our documentation on the <goto> element, which can be found here: http://docs.voxeo.com/voicexml/2.0/goto.htm The complete code example can be found there as well. I hope you find this helpful, and if we can be of any further assistance, please do not hesitate to contact us. Regards, Brian L. Voxeo Support |
|
feel012
|
|
| Hi~ Brian
Thank you for your time and help. You are helping me a lot. Thank you. |
|
bpcamac
|
|
| The documentation above says that the Voxeo platform will always prefetch the URI regardless of the fetchhint value.
Why? Why not follow the requirements of the standard? Such deviation from the spec has a direct impact on our application. We have an instance where the target of the goto element is a VXML page different from the one being processed, and its dynamically generated. Pre-fetching this page would result in its content being inaccurate because of the state the application is in at that time, whereas if it is fetched when the goto element is encountered during the normal course of document processing (i.e. with fetchhint=safe) then the content will be valid. I'm perplexed as to why Voxeo has steered away from the spec on this issue, especially when such deviation takes functionality away from the developer - and apparently for no reason. - Brenton |
|
voxeojeremyr
|
|
| Hi Brenton,
Sorry for any confusion. The 'fetchint' attribute only applies to static content. The <goto> element can, in fact, be used to fetch dynamic content and this data will only be fetched when execution of the document has reached this point. I am going to let the keepers of our documentation know of this omission as we should be more clear in that statement. Let me know if you have any further questions. Thanks, Jeremy Richmond Voxeo Support |
|
bpcamac
|
|
| Thanks Jeremy. It was a bit confusing to me, particularly when I see that the platform does infact observe the fetchhint in such situations despite what the docs claim. If the docs could be clarified in this regard that would be great.
BTW. I noticed the docs use the same phrasing for other vxml elements that have fetchhint - e.g. choice. cheers, Brenton |
|
voxeoblehn
|
|
| Hi Brenton,
We appreciate your feedback. We are currently in the process of updating our VoiceXML documentation and I will pass this along for consideration on our next revision with regards to the <goto> element. Regards, Brian L. Voxeo Support |
|
shawnaslam1
|
|
| hello,
My question is when i use goto to move from one document to other document then i also want to pass some variables along with it. How could we pass the variables values with goto tag. Regards, Shawn Aslam |
|
voxeoblehn
|
|
| Hi Shawn,
Passing variables is not a valid function within the <goto> element. In order to pass along variables when transitioning to a new document, you will need to use the <submit> tab instead. Dissimilar to the goto element, submit will all you to submit a space-delimited list of variables to the destination document. If you would like further clarification, attribute listings, or sample code, please follow the link below to our documentation on the <submit> tag. http://docs.voxeo.com/voicexml/2.0/submit.htm Best Regards, Brian L. Voxeo Support |
|
kunalp25
|
|
| I have been able to use the tag <goto next="#formname"/> to go another form. However, when I try to use the tag to go back to a previous form in the same document (located above another form) it doesnt seem to go back to that previous form. Is it possible to go to any form in the document back and forth?
Thanks... |
|
voxeoJason
|
|
| Not quite. If the field has already been filled you won't be able to hit it again. However you can clear that field like this: <clear namelist="fieldName"/> | |
kunalp25
|
|
| Ok I think I am confused about how this works. The goto prompt will not return to a previously filled form? If you clear the field will this then allow the form to be re-visited? Thank you. | |
voxeo_chris
|
|
| Hello,
I do apologize for any confusion we may have generated. To explain, VoiceXML applications are controlled by the Form Interpretation Algorithm. The FIA basically decides what forms and fields should be visited and one rule of the FIA is to not revisit fields that have been filled. Therefore in order to visit a past field, you will need to clear the field which makes the particular variable undefined, then use the goto to go immediately to that specific field to refill that variable. You can read more about the FIA in the [url=http://www.w3.org/TR/voicexml20/#dmlAFIA]VXML W3C specifications[/url] which will provide details on any questions you have regarding the FIA. Regards, Chris Bruckart Customer Engineer Voxeo Support |
|
kunalp25
|
|
| Ok so from what you mentioned if I clear the field out then I can revisit a form? Basically below I want to do some client side validation for a card before I proceed to another form for more information. However the problem is I dont understand how to reprompt after collecting a 16 digit card and then proceeding to some validation. Does the following make sense?
<form id="enterCard"> <script> <![CDATA[ function luhn_check(card_number) { //some script which I deleted for the post } ]]> </script> <field name="card" type="digits?length=16"> <prompt count="3"> Please enter your card number. </prompt> <filled> <assign name="theCardNo" expr="card"/> You have entered card number.. <prompt><say-as interpret-as="number" format="digits"> <value expr="theCardNo"/></say-as></prompt>. <var name="validation" expr="luhn_check(theCardNo)"/> <if cond="validation=='true'"> <prompt> Something </prompt> <else/> <prompt> Something <clear namelist="card"/> <goto next="#enterCard"/> <!-- want to revisit now that I know the 16 digits entered do not really make sense --> </prompt> </if> </filled> <nomatch> You entered an invalid number. <!-- length error --> <reprompt/> </nomatch> </field> </form> |
|
voxeo_chris
|
|
| Hello again,
There were a few problems I noticed in your code that could be causing you some problem. First off, in looking in your code, the first thing I noticed was that you were referencing the variable validation that is not established anywhere in the code which would cause a reference error. Also if you are attempting to capture an additional yes/no response from the user, you will want to have another field to collect this information. Below is a quick example application that achieves this purpose: [code] <?xml version="1.0" encoding="UTF-8"?> <vxml version="2.1"> <form id="enterCard"> <field name="card" type="digits?length=16"> <prompt count="3"> Please enter your card number. </prompt> <filled> <prompt> You have entered card number.. <say-as interpret-as="number" type="boolean"> <value expr="card"/> </say-as> </prompt>. <clear namelist="valdiation"/> <goto nextitem="validation"/> </filled> </field> <field name="validation" type="boolean"> <prompt> is this correct? </prompt> <filled> <if cond="validation== true"> <prompt> this if statement was hit and we are exiting the application </prompt> <else/> <prompt> since the card number is not correct, we will go back to the first form </prompt> <clear namelist="card"/> <goto nextitem="card"/> </if> </filled> </field> </form> </vxml> [/code] I went ahead and created a second field called validation for this purpose. I also utilized the built-in grammar "boolean" for this if statement. If the user prompts no, the application will clear the first field and use a goto to send him back to that field. Another thing I would recommend is that you place your assign element after the validation field to make the application more simple. Let me know if this makes sense or if you have any questions as I would be happy to help. Regards, Chris Bruckart Customer Engineer Voxeo Support |
|
kunalp25
|
|
| Hey Chris,
Thanks for taking a look at my code. I think the part I am still struggling with is that I don't necessarily want the user to determine the validation. I thought I could assign the value via a script: <var name="validation" expr="luhn_check(theCardNo)"/> and then based on that value recycle back to the enter card number prompt? Can that be done without having to prompt the user again? |
|
kunalp25
|
|
| Ok I modified it a block and now it will try the validation not as a prompt for the user but as just execution of code.
<block name="validation"> <if cond="correctCheckDigit=='true'"> <prompt> Successful Check <value expr="failedCardAttempts"/> </prompt> <else/> <prompt> Failed Check go to card prompt. <value expr="failedCardAttempts"/> <clear namelist="card"/> <goto nextitem="card"/> </prompt> </if> </block> However this all sits in the same form, but I cannot return back to the card field. Is it possible from the block to return back to a previous field provided it is cleared? |
|
kunalp25
|
|
| Sorry! Got it, it will work with a block. I realized I had placed the goto inside the prompt. Sorry about the last post, just wanted to make sure I followed up on that post.
<block name="validation"> <prompt> Testing values in block values <value expr="test"/> </prompt> <clear namelist="card"/> <goto nextitem="card"/> </block> Will work. |
|
antaha
|
|
| Hello,
Im trying to make a vxml code for a restaurants guild but when i tried to branch from the menu to a choice i failed, please check out the code for more clarifications: <?xml version="1.0"?> <!DOCTYPE vxml PUBLIC "vxml" "http://www.w3.org/TR/voicexml20/vxml.dtd"> <vxml version="2.0"> <form id="form2"> <field name="Cousine"> <prompt>please specify the cousine you want? Please choose from the following list: <enumerate/> </prompt> <nomatch> <prompt>I didn't understand you. Please choose from the following list: <enumerate/> </prompt> </nomatch> <option dtmf="1" value="Italian"> Italian </option> <option dtmf="2" value="Egyptian"> Egyptian </option> <option dtmf="3" value="Junk Food"> Seafood </option> <filled> Ok. <if cond="Cousine=='Italian'"> <goto next="#form2"> </if> </filled> </field> </form1> <form id="form2"> <field name="Menu_Italian"> <prompt>Please choose an item from the menu? Please choose from the following list: <enumerate/> </prompt> <nomatch> <prompt>I didn't understand you. Please choose from the following list: <enumerate/> </prompt> </nomatch> <option dtmf="1" value="Pasta Alfrado">Pasta Alfrado</option> <option dtmf="2" value="Pasta napolitana">Pasta napolitana</option> <option dtmf="3" value="Pasta bolognese">Pasta bolognese</option> <option dtmf="4" value="lazania">lazania</option> <option dtmf="5" value="Pizza Margrita">Pizza Margrita</option> <option dtmf="6" value="Pizza Seafood">Pizza Seafood</option> <filled> ok. </filled> </field> </form> </vxml> The problem is in the <goto>, am i using it correctly? if not could it be used in this way? and if not is there any other way to do this? Thank you very much. |
|
mikethompson
|
|
| Hello,
What exact error are you seeing? What is happening when you reach the goto? I think in order to get a full understanding of what's happening in your code, we'll need to see some debugger logs. The full logging detail produced by the Real-time Debugger is immensely helpful when trying to troubleshoot application issues such as this. If you would, please call your application with the Real-time Debugger window open. Then use the "Support" tab at the top of that window to email us the session logs. We will gladly take a look for you... Some helpful links explaining application troubleshooting best practices are at 'http://docs.voxeo.com/voicexml/2.0/frame.jsp?page=mot_appendixb.htm'. Of special interest: - http://docs.voxeo.com/voicexml/2.0/motty_meta.htm#start - http://docs.voxeo.com/voicexml/2.0/loggerfeatures.htm#start - http://docs.voxeo.com/voicexml/2.0/gettingsupport.htm#start Thank You, Mike Thompson Voxeo Corporation |
|
bobby.christensen
|
|
| Hello there,
I am trying to use validate a user's response before submitting it to the form, but I want to limit the number of tries they have to change their response to 3. Also, on the 3rd attempt I want to send them to a "endCall.xml" page that gives a message and ends the call. I am not sure whether to use an <if> block or if there is a better direction to go. This is the snippet of code I have and am stuck at: <field name="confirmLogin" type="boolean"> <prompt bargein="false"> you entered <value expr="login" /> , is this correct? </prompt> //option is no clarified yet <option? count="3"> <goto next="endCall.xml"/> </option> Thank you in advance, I appreciate all you guys do for the loyal followers. Bobby |
|
mikethompson
|
|
| Hi Bobby,
Count is actually not a valid attribute of option, so that won't work. I think the best approach to take here would be to use the built-in boolean grammar in conjunction with some <if> conditional logic. [code] <vxml version="2.0"> <var name="counter" expr="0"/> <form id="F1"> <field name="F_1" type="boolean"> <prompt> is this information correct? </prompt> <filled> <if cond="F_1=='yes'"> <prompt> Ok Great </prompt> <log expr="'******** User confirmed information *********'"/> <goto next="http://www.mypage.com/MyNextPage.xml"/> <elseif cond="F_1=='no' && counter & lt; 3"/> <assign name="counter" expr="counter+1"/> <log expr="'*********** our counter is: ' + counter + '***********'"/> <prompt> Ok, thank you, let's try again </prompt> <goto next="http://www.mypage.com/TryAgain.xml"/> <else/> <prompt> I'm sorry, you cannot correct your credentials anymore </prompt> <goto next="MyCleanup.xml"/> </if> </filled> </field> </form> </vxml> [/code] In order to keep track of how many times they have denied the information, you can simply add a counter in your conditional logic for "no." Note: Make sure to remove the space between & lt; in the conditional logic, so XML properly parses a < symbol for you without choking. I simply added the space so you could see that you need to encode the < so XML will properly parse the file. Hope this helps, Mike Thompson Voxeo Corporation |
|
mee
|
|
| Hi, I'm trying to navigate from a vxml file to a python script and back to the vxml file but I am having a bit of trouble going back to the vxml file. Here is what I've got:
-----Start.vxml------------------------------- <?xml version="1.0" encoding="UTF-8"?> <vxml version = "2.0"> <var name="actor" expr="'Tony Danza'"/> <var name="show" expr="'Who\'s the boss'"/> <var name="score" expr="1600"/> <form> <block> We are in Start.vxml <submit next="http://localhost:8000/cgi-bin/moving.py" method="get" namelist="actor show score"/> </block> </form> <form id="next"> <block> Here AGAIN</block> </form> </vxml> ---------------------------------------------- -----moving.py-------------------------------- """ moving.py The process should be: 1) start.vxml passes values to moving.py 2) moving.py prints new vxml form with values from start.py 3) moving.py goes back to start.vxml 4) start.py prints something """ import cgi #Variable to keep the parameters fs = cgi.FieldStorage() if __name__=='__main__': actor=fs['actor'].value show=fs['show'].value score=fs['score'].value print "Content-type: application/xml\n\n" print """<vxml version = "2.0"> <form> <block> This is the output of moving.py My favorite actor is %s My favorite TV show is %s Tony's SAT score was %s <goto next="http://localhost:8000/cgi-bin/Start.vxml#next"/> <!-- Here I want to go back to Start.vxml and move to the #next form. I have tried a few options, but it just won't go anywhere. none of the options below seem to work either: <goto next="http://localhost:8000/cgi-bin/#next"/> <goto next="Start.vxml#next"/> <goto next="#next"/> --> </block> </form> </vxml>""" % (actor, show, score) ---------------------------------------------- The output I get from OptimTalk is: ---------------------------------------------- We are in Start.vxml This is the output of moving.py My favorite actor is Tony Danza My favorite TV show is Who's the boss Tony's SAT score was 1600 An unhandled error event occurred. The interpretation cannot continue. ---------------------------------------------- So it everything works properly in the python script until it gets to <submit> tag. The error seems kind of cryptic, but here's what the server has to say: ---------------------------------------------- localhost - - [07/Jan/2010 12:16:53] "GET /cgi-bin/moving.py?actor=Tony%20Danza&show=Who%27s%20the%20boss&score=1600 HTTP/1.1" 200 - localhost - - [07/Jan/2010 12:16:53] command: /usr/bin/python -u "/home/SummerProject/cgi-bin/moving.py" localhost - - [07/Jan/2010 12:16:53] CGI script exited OK localhost - - [07/Jan/2010 12:16:53] "HEAD /cgi-bin/Start.vxml HTTP/1.1" 200 - localhost - - [07/Jan/2010 12:16:53] command: /home/SummerProject/cgi-bin/Start.vxml "" localhost - - [07/Jan/2010 12:16:53] /home/SummerProject/cgi-bin/Start.vxml: 1: Syntax error: newline unexpected localhost - - [07/Jan/2010 12:16:53] CGI script exited OK localhost - - [07/Jan/2010 12:16:53] "GET /cgi-bin/Start.vxml HTTP/1.1" 200 - localhost - - [07/Jan/2010 12:16:53] command: /home/SummerProject/cgi-bin/Start.vxml "" localhost - - [07/Jan/2010 12:16:53] /home/SummerProject/cgi-bin/Start.vxml: 1: Syntax error: newline unexpected localhost - - [07/Jan/2010 12:16:53] CGI script exited OK ---------------------------------------------- It seems to try twice to get back to the Start.vxml file and both times gets the same error: "Start.vxml: 1: Syntax error: newline unexpected" What newline? What am I doing wrong? mee |
|
mee
|
|
| Hi, I'm trying to navigate from a vxml file to a python script and back to the vxml file but I am having a bit of trouble going back to the vxml file. Here is what I've got:
-----Start.vxml------------------------------- <?xml version="1.0" encoding="UTF-8"?> <vxml version = "2.0"> <var name="actor" expr="'Tony Danza'"/> <var name="show" expr="'Who\'s the boss'"/> <var name="score" expr="1600"/> <form> <block> We are in Start.vxml <submit next="http://localhost:8000/cgi-bin/moving.py" method="get" namelist="actor show score"/> </block> </form> <form id="next"> <block> Here AGAIN</block> </form> </vxml> ---------------------------------------------- -----moving.py-------------------------------- """ moving.py The process should be: 1) start.vxml passes values to moving.py 2) moving.py prints new vxml form with values from start.py 3) moving.py goes back to start.vxml 4) start.py prints something """ import cgi #Variable to keep the parameters fs = cgi.FieldStorage() if __name__=='__main__': actor=fs['actor'].value show=fs['show'].value score=fs['score'].value print "Content-type: application/xml\n\n" print """<vxml version = "2.0"> <form> <block> This is the output of moving.py My favorite actor is %s My favorite TV show is %s Tony's SAT score was %s <goto next="http://localhost:8000/cgi-bin/Start.vxml#next"/> <!-- Here I want to go back to Start.vxml and move to the #next form. I have tried a few options, but it just won't go anywhere. none of the options below seem to work either: <goto next="http://localhost:8000/cgi-bin/#next"/> <goto next="Start.vxml#next"/> <goto next="#next"/> --> </block> </form> </vxml>""" % (actor, show, score) ---------------------------------------------- The output I get from OptimTalk is: ---------------------------------------------- We are in Start.vxml This is the output of moving.py My favorite actor is Tony Danza My favorite TV show is Who's the boss Tony's SAT score was 1600 An unhandled error event occurred. The interpretation cannot continue. ---------------------------------------------- So it everything works properly in the python script until it gets to <goto> tag. The error seems kind of cryptic, but here's what the server has to say: ---------------------------------------------- localhost - - [07/Jan/2010 12:16:53] "GET /cgi-bin/moving.py?actor=Tony%20Danza&show=Who%27s%20the%20boss&score=1600 HTTP/1.1" 200 - localhost - - [07/Jan/2010 12:16:53] command: /usr/bin/python -u "/home/SummerProject/cgi-bin/moving.py" localhost - - [07/Jan/2010 12:16:53] CGI script exited OK localhost - - [07/Jan/2010 12:16:53] "HEAD /cgi-bin/Start.vxml HTTP/1.1" 200 - localhost - - [07/Jan/2010 12:16:53] command: /home/SummerProject/cgi-bin/Start.vxml "" localhost - - [07/Jan/2010 12:16:53] /home/SummerProject/cgi-bin/Start.vxml: 1: Syntax error: newline unexpected localhost - - [07/Jan/2010 12:16:53] CGI script exited OK localhost - - [07/Jan/2010 12:16:53] "GET /cgi-bin/Start.vxml HTTP/1.1" 200 - localhost - - [07/Jan/2010 12:16:53] command: /home/SummerProject/cgi-bin/Start.vxml "" localhost - - [07/Jan/2010 12:16:53] /home/SummerProject/cgi-bin/Start.vxml: 1: Syntax error: newline unexpected localhost - - [07/Jan/2010 12:16:53] CGI script exited OK ---------------------------------------------- It seems to try twice to get back to the Start.vxml file and both times gets the same error: "Start.vxml: 1: Syntax error: newline unexpected" What newline? What am I doing wrong? mee |
|
voxeojeremyr
|
|
| Hello Mee,
The error that you described in your post is coming from the python server. I am not an expert but it appears that Python may have an issue with one of the characters in the line: <goto next="http://localhost:8000/cgi-bin/Start.vxml#next"/> What we usually recommend to developers is to call your Python script through a web browser. If it returns valid VXML than you should be fine. However in this case this does not appear to be happening. If you have any other questions, please let us know. Regards, Jeremy Richmond Voxeo Support |
|
mee
|
|
|
That's right, it looks like it doesn't like something in the line <goto next="http://localhost:8000/cgi-bin/Start.vxml#next"/> but I think what it does not like is the file extension. It works perfectly when I send it to another python script: <goto next="http://localhost:8000/cgi-bin/a.py"/> But I have figured it out, it just does not like the vxml file to be inside the cgi-bin folder. It works ok when it's out. Thanks! mee |
|
asis1988
|
|
| hi!!
I´m doing a vxml aplication in voxeo, but i cant do a thing. I´ve created a php file that make a xml grammar. It works properly and generate the grammar, but I want that this php file executes when my vxml aplication starts, I means every time the vxml aplication starts, it must start the php execution to get a dinamic grammar. I try it with <goto next="http://astrar.homeftp.net/info.php"/> but this dont generate the grammar. The aplication dont tell me any error, but when the aplication goes to read the grammar file, tell me that can´t find the file. can anyone help me?? |
|
jdyer
|
|
| Hello,
The goto element is really designed to transition the execution context of the application from one form, to another form within the current document. You can also transition to another document entirely, or to a specific form in another document. If you are looking to simply load a dynamic grammar you may be looking for the grammar element, along with the src attribute to target your php page. If we are perhaps not correctly understanding your goals here please let us know, as our team is most certainly standing by to help! Regards, John Dyer Customer Engineer Voxeo Support |
|
asis1988
|
|
| Thanks John. I try to explain it better: I have got a php file in http://astrar.homeftp.net/info.php. This file generate the grammar inside the file http://astrar.homeftp.net/lista.xml. I only want to execute the php file when my vmxl aplicattion starts to generate this grammar in the lista.xml file.
Then of this, I know how to read the grammar from the xml file. I mean, the only thing I dont know how to do is execute the php file before read the grammar. THANKS ! |
|
voxeoJeffK
|
|
| Hello,
You can do this using <data>, and have the PHP file return a simple XML structured return so the the <data> call is successful. http://www.vxml.org/data.htm <data name="MyData" src="http://astrar.homeftp.net/info.php"/> will cause the PHP to be executed so that it can generate the lista.xml file. Regards, Jeff Kustermann Voxeo Support |
|
asis1988
|
|
| if i undestand you correctly, this allows me to read a file php that have got the grammar,its correct?
I dont want do this. My php file creates a xml grammar inside the page "http://astrar.homeftp.net/lista.xml", that have this content: <grammar xmlns="http://www.w3.org/2001/06/grammar" xml:lang="en-US" root = "MYRULE"> <rule id="MYRULE" scope="public"> <one-of> <item> Abrantes </item> <item> Acacias </item> <item> Aeropuerto T1 T2 T3 </item> <item> Aeropuerto T4 </item> </one-of> </rule> </grammar> To create this grammar file I need to execute the php file "http://astrar.homeftp.net/info.php", so I need tu run this php file from voicexml. I only need to call this php file, because the grammar is created and readed correctly if I execute manually the php file before to execute the vxml aplication. So I only need to call the "http://astrar.homeftp.net/info.php", that have got this cotent: <?php include('C:/parser/simplehtmldom/simple_html_dom.php'); $aux = $_REQUEST["aux"]; function elimina_acentos($cadena){ $tofind = "ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ-'´`"; $replac = "AAAAAAaaaaaaOOOOOOooooooEEEEeeeeCcIIIIiiiiUUUUuuuuyNn "; return(strtr($cadena,$tofind,$replac)); } $html = file_get_html('http://www.metromadrid.es/es/viaja_en_metro/trayecto_recomendado/index.html'); $ret = $html->find('#estacion'); $orig = $ret[0]->find('option'); $salida = array_slice ($orig, 1); //quito la opcion "Elija una opcion..." $tam = sizeof($salida); for($i=0;$i<$tam;$i++){ $salida[$i]=elimina_acentos(strip_tags($salida[$i]));} $lista= fopen("lista.xml","w+"); $contenido='<?xml version="1.0" encoding="utf-8"?>'; $contenido.='<grammar xmlns="http://www.w3.org/2001/06/grammar" xml:lang="en-US" root = "MYRULE">'; $contenido.="\r\n\r\n"; $contenido.='<rule id="MYRULE" scope="public">'; $contenido.="\r\n\r\n<one-of>\r\n\r\n"; foreach ($salida as $value) { $contenido.="\r\n\r\n<item>"; $contenido.=$value; $contenido.="</item>"; } $contenido.="\r\n\r\n</one-of>\r\n\r\n</rule>\r\n\r\n</grammar>"; fwrite($lista,$contenido); ?> I hope this explain better my problem. THANKS! |
|
voxeoJeffK
|
|
| Hello,
Yes, this what I intended. The <data> tag allows you to execute an external file (your PHP file) while not leaving the present VXML document. You don't have to return a grammar. You can have your PHP create the grammar in a separate file. However the <data> element must have *something* returned in XML format or else an error will be thrown. So have your PHP create the separate grammar file, and then echo out a small XML file like this: <?xml version="1.0" ?> <xml> <result>success</result> </xml> Regards, Jeff Kustermann Voxeo Support |
|
asis1988
|
|
| thanks jeff, i fixed it doing what you post.
I´ve finished my work,THANK YOU!! |
|
rubinikuttyomkumar
|
|
| Hi
I am new to VXML. I have written a vxml script , which when executing gives error.semantic.ecmascript. I am not able to find out where i am wrong. Please guide me where i am wrong. [code] <form id ="PlayBack"> <field name ="PlayBackUserDigits"> <prompt> <audio src="PlayBack_SayOption.wav" fetchhint="safe" fetchtimeout="10000ms"/> </prompt> <option dtmf="1" value="Confirm"/> <option dtmf="2" value="ReEnter"/> <noinput> <audio src = "NoInput.wav" fetchhint = "prefetch" fetchtimeout="10s"/> <reprompt/> </noinput> <nomatch> <audio src = "NoMatch.wav" fetchhint = "prefetch" fetchtimeout = "10s"/> <reprompt/> </nomatch> <noinput count = "4"> <audio src = "ExceededLimit.wav" fetchhint = "prefetch" fetchtimeout="10s"/> <goto next="Hangup.vxml"/> </noinput> <nomatch count = "4"> <audio src = "ExceededLimit.wav" fetchhint = "prefetch" fetchtimeout="10s"/> <goto next="Hangup.vxml"/> </nomatch> <filled> <if cond="PlayBackUserDigits == 'Confirm'"> <log expr ="'User has confirmed the digits pressed'+SecretCodeValue"/> <goto next ="GetBalance.vxml" fetchhint="prefetch" fetchtimeout="10s"/> <elseif cond="PlayBackUserDigits == 'ReEnter'"/> <log expr ="'User requested for re - enter '"/> <goto next="#OwnTopUp"/> </if> </filled> </field> </form> </vxml> Whenever |
|
rubinikuttyomkumar
|
|
| Sorry for the discontinuity in previous post .Whenever 1 is executed, i am getting this error . Please let me know where i am wrong | |
voxeo_dmiranda
|
|
| Hello,
Where in the code are you generating the value for SecretCodeValue? I mapped up this code to a test app and as soon as I removed SecretCodeValue from the log statement, it worked fine. I would like to see your entire code if possible. If you would be more comfortable attaching your code to a private support ticket, feel free and open one. Regards, David Miranda Customer Support Engineer Voxeo Corporation |
| login |