| VoiceXML 2.1 Development Guide | Home | Frameset Home |
|
<field>, but how the heck to we pass it along to another page, and do something dynamic with it? Well, once we accept caller input, we can send this to a dynamic page by using the <submit> or <data> elements, and specifying the variable names we want to send across within the namelist attribute:
<field name=" F_1" type="boolean">
<prompt>Is there anything more stupid than dog sweaters?</prompt>
<filled>
<submit next="http://MyServer.com/MyPage.asp" namelist="F_1" method = "get"/>
</filled>
</field>
<submit>via GET method to another document, and tack on some variables in the namelist, we will see the following in the voxeo application debugger:Now going to: http://MyServer.com/MyPage.asp?F_1=yesNow going to: http://MyServer.com/MyPage.asp
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1">
<form>
<block>
<prompt>
When asked if anything was more colossally dumb than dog sweaters, you indicated that this is
<value expr=F_1>
</prompt>
</block>
</form>
</vxml>
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1">
<%
' ******************************************************
' Grab the querystring variable via ASP
MyASPQueryStringVar = request.querystring("F_1")
'*******************************************************
' store it as a voicexml variable local to this page
'*******************************************************
response.write "<var name=""MyVxmlVar"" expr=""" & MyASPQueryStringVar & """/>"
%>
<form>
<block>
<prompt>
When asked if anything was more colossally dumb than dog sweaters, you answered
<value expr="MyVxmlVar">
</prompt>
</block>
</form>
</vxml>
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1">
<var name="CallerID" expr="session.callerid"/>
<form id="form_Main">
<field name="digit1" type="digits?length=2">
<prompt bargein="false">Lets add two digit values together</prompt>
<prompt>Please speak, or key in any two digit value</prompt>
<filled>
<log expr="'*** FILLED ***'"/>
<log expr="'*** digit1 =' + digit1 + '***'"/>
</filled>
</field>
<field name="digit2" type="digits?length=2">
<prompt bargein="false">Great.</prompt>
<prompt>Now speak, or key in the second two digit value</prompt>
<filled>
<log expr="'*** FILLED ***'"/>
<log expr="'*** digit2 =' + digit2 + '***'"/>
<submit next="AddDigits.cfm" method="get" namelist="digit1 digit2 CallerID"/>
</filled>
</field>
</form>
</vxml>
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1">
<CFOUTPUT>
<!-- grab our querystring variables -->
<!-- assign them as new ColdFusion variables -->
<cfset MyCFVar1 ="#digit1#">
<cfset MyCFVar2 ="#digit2#">
<cfset MyCallerID ="#CallerID#">
<!-- perform arithmatic on the two querystring values -->
<!-- store the added total in a new ColdFusion variable -->
<cfset MyTotal = "#Evaluate(MyCFVar1 + MyCFVar2)#">
<form id="F1">
<block>
<prompt>
#MyCFVar1# plus #MyCFVar2# equals #MyTotal#.
<break/>
</prompt>
<prompt>
Just for kicks, let's count up to the total.
<break/>
<CFLOOP INDEX = "i" FROM ="1" TO ="#MyTotal#" STEP="1">
#i# missisippi
<break/>
</CFLOOP>
</prompt>
<prompt>
See ya later,
<say-as interpret-as="telephone">#MyCallerID#</say-as>
</prompt>
</block>
</form>
</CFOUTPUT>
</vxml>
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1">
<form id="form_Main">
<field name="digit1" type="digits?length=2">
<prompt bargein="false">Lets add two digit values together</prompt>
<prompt>Please speak, or key in any two digit value</prompt>
<filled>
<log expr="'*** FILLED ***'"/>
<log expr="'*** digit1 =' + digit1 + '***'"/>
</filled>
</field>
<field name="digit2" type="digits?length=2">
<prompt bargein="false">Great.</prompt>
<prompt>Now speak, or key in the second two digit value</prompt>
<filled>
<log expr="'*** FILLED ***'"/>
<log expr="'*** digit2 =' + digit2 + '***'"/>
<assign name="callerID" expr="'<%=Request("session.callerid")%>'"/>
<submit next="AddDigits.asp" method="" namelist="digit1 digit2 callerID"/>
</filled>
</field>
</form>
</vxml>
<%
Dim digit1, digit2, digitTotal, callerID
//get int versions of each digit
digit1 = CInt(Request("digit1"))
digit2 = CInt(Request("digit2"))
//get the sum of our digits
digitTotal = digit1 + digit2
//grab callerID from our submitted namelist
callerID = Request("callerID")
%>
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1">
<form id="form_main">
<block>
<prompt>
<%=digit1%> plus <%=digit2%> equals <%=digitTotal%>.
<break/>
</prompt>
<prompt>
Just for kicks, let's count up to the total.
<break/>
<%
Dim i
For i = 1 To digitTotal
Response.Write( i & " mississippi " )
Next
%>
<break/>
</prompt>
<prompt>
See ya later, <say-as interpret-as="telephone"><%=callerID%></say-as>.
</prompt>
</block>
</form>
</vxml>
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1">
<form id="form_Main">
<field name="digit1" type="digits?length=2">
<prompt bargein="false">Lets add two digit values together</prompt>
<prompt>Please speak, or key in any two digit value</prompt>
<filled>
<log expr="'*** FILLED ***'"/>
<log expr="'*** digit1 =' + digit1 + '***'"/>
</filled>
</field>
<field name="digit2" type="digits?length=2">
<prompt bargein="false">Great.</prompt>
<prompt>Now speak, or key in the second two digit value</prompt>
<filled>
<log expr="'*** FILLED ***'"/>
<log expr="'*** digit2 =' + digit2 + '***'"/>
<assign name="MyCallerID" expr="'<%=request.getParameter("session.callerid")%>'"/>
<submit next="AddDigits.jsp" namelist="digit1 digit2 MyCallerID"/>
</filled>
</field>
</form>
</vxml>
<%
int digit1 = 0;
int digit2 = 0;
try {
//get int value for our digit1
digit1 = Integer.parseInt(request.getParameter("digit1"));
} catch (Exception e) {}
try {
//get int value for digit2
digit2 = Integer.parseInt(request.getParameter("digit2"));
} catch (Exception e) {}
//get the sum of our digits
int digitTotal = digit1 + digit2;
//grab callerID from our submitted namelist
String callerID = request.getParameter("MyCallerID");
%>
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1">
<form id="form_main">
<block>
<prompt>
<%=digit1%> plus <%=digit2%> equals <%=digitTotal%>.
<break/>
</prompt>
<prompt>
Just for kicks, let's count up to the total.
<break/>
<%
for (int i = 0; i < digitTotal; ++i) {
out.println( (i+1) + " mississippi" );
}
%>
<break/>
</prompt>
<prompt>
See ya later, <say-as interpret-as="telephone"><%=callerID%></say-as>.
</prompt>
</block>
</form>
</vxml>
<?php
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
?>
<vxml version="2.1">
<form id="form_Main">
<var name="callerID" expr="session.callerid"/>
<field name="digit1" type="digits?length=2">
<prompt bargein="true">Lets add two digit values together</prompt>
<prompt>Please speak, or key in any two digit value</prompt>
<filled>
<log expr="'**** FILLED ******'"/>
<log expr="'**** digit1 =' + digit1 + ' ***'"/>
</filled>
</field>
<field name="digit2" type="digits?length=2">
<prompt bargein="false">Great.</prompt>
<prompt>Now speak, or key in the second two digit value</prompt>
<filled>
<log expr="' *** FILLED *********'"/>
<log expr="' *** digit2 =' + digit2 + ' ***'"/>
<submit next="AddDigits.php" method="get" namelist="digit1 digit2 callerID"/>
</filled>
</field>
</form>
</vxml>
<?php
//grab each digit and callerID from our submitted namelist
$digit1 = $_REQUEST["digit1"];
$digit2 = $_REQUEST["digit2"];
$callerID = $_REQUEST["callerID"];
header('Cache-Control: no-cache');
//get the sum of our digits
$digitTotal = $digit1 + $digit2;
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
?>
<vxml version="2.0">
<form id="form_main">
<block>
<prompt>
<?php echo $digit1?> plus <?php echo $digit2?> equals <?php echo $digitTotal?>.
<break/>
</prompt>
<prompt>
Just for kicks, let's count up to the total.
<break/>
<?php
for ($i=1; $i<=$digitTotal; $i++)
{
echo $i . " mississippi ";
}
?>
<break/>
</prompt>
<prompt>
See ya later, <say-as interpret-as="telephone"><?php echo $callerID?></say-as>.
</prompt>
</block>
</form>
</vxml>
| ANNOTATIONS: EXISTING POSTS |
msyriani
|
|
| In the jsp example, variable MyCallerID is used and then variable callerid is used. This is causing an error. To fix this problem, replace CallerID with MyCallerID or replace MyCallerID with CallerID.
Also, method is set to empty string. replace with GET or POST |
|
MattHenry
|
|
| Wwell, someone wipe the egg from my face.
=8^) Seriously, thanks for catching those typos. I have them corrected in our internal doc build, and these changes will be reflected in the 'live' docs within the next week or two. Regards, ~Matt |
|
rajach
|
|
| Hi,
Can some one please tell me how to pass a parameter from JSP page to VXML. Here in this example all I see is passing parameters from VXML to ASP page or JSP page. Is the other way possible? If so please email me the code at rsreddych@yahoo.com. Thanks in advance. Rajach |
|
MattHenry
|
|
| Hiya Raj,
To tweak our JSP example above, (AddDigits.jsp), we could do something like this: <vxml version="2.1"> <var name="Num1" expr="<%=digit1%>"/> <var name="Num2" expr="<%=digit2%>"/> ..... <form id="form_main"> <block> <prompt> <value expr="Num1"/> plus <value expr="Num2"/> equals <%=digitTotal%>. <break/> </prompt> .... Hope this helps to clarify, ~Matt |
|
JimMurphy
|
|
| rajach,
There are a couple of ways to pass variables from JSP to VXML. Since JSP or any server-side language is processed before the XML is rendered, you can simply plug variables into the XML. Assuming that you have a variable called "sampleVar" in JSP: ------------------------ <form id="form_main"> <block> <prompt> The value of the test variable is <%=testVar%> <break/> </prompt> ... ------------------------ You'd essentially dynamically build the xml, plugging in the variables you need. This assumes the JSP variables you wish to use are readily accesible when the vxml is rendered. If you want to take JSP variables that are not accessible at the time the vxml is rendered, you can either use a <subdialog> which references another dynamic document, or you can <goto> another dynamic page. Does that answer your question? Jim |
|
rajach
|
|
| Thank a lot to both of you. Let me try and will get back to you if I have any problem. Thanks once again | |
rajach
|
|
| Hi,
I have a problem here. I have two Variables called "ANI" and "DNIS" in VXML. I am assigning values using the expressions <var name="ANI" expr="session.connection.remote.uri"/> <var name="DNIS" expr="session.connection.local.uri"/> I want to check for the condition if ANI and DNIS contains a string "tel:", and then I want to strip those four characters from these two variables. Can some one please tell me how can I check this condition in VXML. Here is my code in JSP page which includes the 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" > <var name="TrunkNumber" expr="session.connection.ctiport"/> <var name="ANI" expr="session.connection.remote.uri"/> <var name="DNIS" expr="session.connection.local.uri"/> <var name="callType"/> <var name="memberID"/> <var name="product" expr=""/> <var name="agentskill" expr=""/> <form id="collectRequest"> <block> <audio src="prompts/welcome.wav"/> </block> <script> ANI = ANI.substring(4); DNIS = DNIS.substring(4); </script> <block> <prompt> port number <value expr="TrunkNumber"/> </prompt> <prompt> dnis <audio src="pause:750"/> <prosody rate="slow"> <say-as type="telephone"> <value expr="DNIS"/> </say-as> </prosody> </prompt> <prompt> annie <audio src="pause:750"/> <say-as type="telephone"> <value expr="ANI"/> </say-as> </prompt> </block> <block name="wrap_up"> <submit next="<%=request.getContextPath()%>/routerequest" namelist="TrunkNumber ANI DNIS callType memberID"/> </block> </form> </vxml> Thanks in advance. Your help is really appreicated. Rajach |
|
Michael.Book
|
|
| Hi Rajach,
Is there a particular reason you are grabbing the SIP ANI and/or DNIS addresses (i.e. 'session.connection.local.uri')? If you just want the plain 10-digit telephone nunber, simply use 'session.callerid' and 'session.calledid'. Will this give you the values your want? On a side note... You may want to take a peek at the documentation for the <say-as> element - 'http://docs.voxeo.com/voicexml/2.0/frame.jsp?page=say-as.htm'. I don't think your <say-as> tags will work as-is. Also note that the default TTS voice (Speechify) does not support SSML (i.e. <prosody>). If you would like to use the <prosody> tag, you must use the Rhetorical TTS engine. Check out 'http://docs.voxeo.com/voicexml/2.0/frame.jsp?page=appendixn.htm' for usable information. I hope this helps... Have Fun, ~ Michael Voxeo Community Support |
|
rajach
|
|
| Hi Michael,
Thanks for the reply. I tried your solution by setting <var name="ANI" expr="session.callerid"/> <var name="DNIS" expr="session.calledid"/> This one not at all working. The following code is working properly. My only doubt is whether SIP ANI/DNIS addresses I am capturing through <var name="ANI" expr="session.connection.remote.uri"/> <var name="DNIS" expr="session.connection.local.uri"/> will always have "tel:" prefixed to this address or not. In following I am stripping first 4 characters of ANI and DNIS. If "session.connection.remote.uri" and "session.connection.local.uri" does not contain "tel:" then this code will not work since I am stripping first 4 characters in ANI and DNIS. Can you please clarify me whether SIP ANI/DNIS does always contain "tel:". As far as <say-as> tag in my code, it seems it working properly. But I will definitely go thorugh your suggestions. Thanks for the help. <?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" > <var name="TrunkNumber" expr="session.connection.ctiport"/> <var name="ANI" expr="session.connection.remote.uri"/> <var name="DNIS" expr="session.connection.local.uri"/> <var name="callType"/> <var name="memberID"/> <var name="product" expr=""/> <var name="agentskill" expr=""/> <form id="collectRequest"> <block> <audio src="prompts/welcome.wav"/> </block> <script> ANI = ANI.substring(4); DNIS = DNIS.substring(4); </script> <block> <prompt> port number <value expr="TrunkNumber"/> </prompt> <prompt> dnis <audio src="pause:750"/> <prosody rate="slow"> <say-as type="telephone"> <value expr="DNIS"/> </say-as> </prosody> </prompt> <prompt> annie <audio src="pause:750"/> <say-as type="telephone"> <value expr="ANI"/> </say-as> </prompt> </block> <block name="wrap_up"> <submit next="<%=request.getContextPath()%>/routerequest" namelist="TrunkNumber ANI DNIS callType memberID"/> </block> </form> </vxml> Thanks, Rajach |
|
Michael.Book
|
|
| Rajach,
I am not sure at all why the 'session.callerid' and 'session.calledid' is not working for you. Try adding these lines to one of your forms, you will see in your logs that the straight, ten-digit ANI and DNIS are indeed included therein: ____________________ <block> <log expr="'*** ANI: ' + session.callerid + ' ***'"/> <log expr="'*** DNIS: ' + session.calledid + ' ***'"/> </block> ____________________ On this note, try removing the DTD declaration at the top of your document and change your VXML version to 2.1, like so: ____________________ <?xml version="1.0"?> <vxml version="2.1"> ____________________ This may be what's causing problems for these session variables. As far as your question though... Yes, using the 'session.connection.local.uri' and 'session.connection.remote.uri' will always have a tel: or sip: syntax, as per the VoiceXML spec. I hope this helps... ~ Michael |
|
nachiket
|
|
| hi,
Can anybody tell me how to assign a vxml variable to asp variable in the same document. Thanks in advance. |
|
JimMurphy
|
|
| nachiket,
This is really an issue of scope. When a page loads, asp is processed by the webserver first, then the client side code is rendered (HTML, VXML, etc...). There are three ways you can go about assigning a vxml variable to an .asp variable. 1 ----------------- The obvious first way is to load a new document, passing your vxml variables on the querystring. You can do so using <submit>, with the namelist attribute. eg. <?xml version="1.0" encoding="UTF-8"?> <vxml version = "2.1"> <form id="F1"> <block> <var name="SomeCoolVar" expr="'SomeCoolValue'"/> <prompt> preparing to submit. </prompt> <submit next="MyDestinationPage.jsp" method="get" namelist="SomeCoolVar"/> </block> </form> </vxml> 2 ----------------- The second way would be to use a <subdialog> to load a new dynamic page from your web server, passing vxml variables on the querystring (which can then become .asp variables). Additionally, when the <subdialog> exits, it can pass variables back to the vxml. There are some samples of this here: http://docs.voxeo.com/voicexml/2.0/subdialog.htm 3 ----------------- Along the same lines as #2 above, you can use the <data> element to submit vxml variables back your web server, where you can make them .asp variables. You can also get return variables back. A good sample are the last two examples at: http://docs.voxeo.com/voicexml/2.0/data.htm I imagine you'll have more questions, and we're glad to help. If you do have additional questions, please open a support ticket inside your Evolution account. Jim http://docs.voxeo.com/voicexml/2.0/data.htm |
|
Asier
|
|
| Hi there,
I need help another time, i'm sorry but i need know receive variables from a file.php, i would be very grateful, if you can tell me a link with information about this or you can put a smple code Asier |
|
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 |
|
steve.sax
|
|
|
Hi there, I think there is a bit of confusion here; the documentation posts are really meant to add/request clarification of documented material, not for debugging assistance...you'd really be better off creating an account ticket for inquiries such as this. However, to address your question, you would do well to read our tutorials on VXML, where voice/dtmf recognition is fully detailed and illustrated: http://www.voicexmlguide.com/tutorialhome.htm Steve Sax |
|
pacific_is_me
|
|
| Hi, sorry for my last fool question. But I have a right question here :). Please read my code below.
index.php: <?php include "./include/include.inc.php"; $check_session=session_is_registered("ivr_lang_id"); if($check_session) { session_unregister("ivr_lang_id"); } $dir = "index.php"; $sql = "SELECT lang_id, ivr_message, ivr_wave, ivr_name FROM " . DB_PREFIX . "ivr_message WHERE stage_number=1 ORDER BY lang_id"; $res = $sqlpt->sql_query($sql,$db,$err); if ( !$res ) { exit(); } $lang_id_array = array(); $ivr_message_array = array(); $ivr_wave_array = array(); $i=0; while ( list($lang_id,$ivr_message,$ivr_wave) = $sqlpt->sql_next_row($res) ) { $lang_id_array[$i] = $lang_id; $ivr_wave_array[$i] = $ivr_wave; $ivr_message_array[$i++] = $ivr_message; } $res = $sqlpt->sql_query($sql,$db,$err); if ( !$res ) { exit(); } while ($row = $sqlpt->sql_fetch_array($res)) { $ivr_name=$row["ivr_name"]; } ?> <vxml version="2.1" xmlns="http://www.w3.org/2001/vxml" 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"> <menu id="MainMenu"> <property name="inputmodes" value="dtmf"/> <!--SPEAK GREETING AND LANGUAGE SELECTION--> <prompt> <?php for ( $i=0; $i < count($lang_id_array); $i++ ) { if($ivr_wave_array[$i]=="" && $ivr_message_array[$i]=="") { echo "ERROR"; } if($ivr_wave_array[$i]!="" && $ivr_name==WELCOME) { echo "<audio src=\"". get_wave_url($ivr_wave_array[$i], WAVE_DIR, $dir ) ."\" />\n"; } elseif($ivr_wave_array[$i]=="" && $ivr_name==WELCOME) { echo "$ivr_message_array[$i]\n"; } } ?> </prompt> <!--#################END#################--> <!--GENERATE MENU CHOICE TAGS FOR THE LANGUAGES--> <?php $sql = "SELECT ivr_id FROM " . DB_PREFIX . "languages ORDER BY ivr_id"; $res = $sqlpt->sql_query($sql,$db,$err); if ( !$res ) { exit(); } $ivr_id_array = array(); $i = 0; while ( list($ivr_id) = $sqlpt->sql_next_row($res) ) { $ivr_id_array[$i++] = $ivr_id; } for ( $i = 0; $i < count($ivr_id_array); $i++ ) { echo "<choice dtmf=\"" . $ivr_id_array[$i] . "\"" . " next=\"category_listing.php?ivr_lang_id=" . $ivr_id_array[$i] . "\"/>\n"; } ?> <!--######################END####################--> <!--IF THERE IS NO INPUT FROM CLIENT--> <noinput> Sorry, I did not hear anything. Please choose your language. <reprompt/> </noinput> <!--IF THE INPUT FROM CLIENT IS NOT MATCH--> <nomatch> Sorry, I did not recognize your input. Please try again. <reprompt/> </nomatch> </menu> </vxml> This file works well. But when I add more field in my URI in my menu like this: <!--GENERATE MENU CHOICE TAGS FOR THE LANGUAGES--> <?php $sql = "SELECT ivr_id FROM " . DB_PREFIX . "languages ORDER BY ivr_id"; $res = $sqlpt->sql_query($sql,$db,$err); if ( !$res ) { exit(); } $ivr_id_array = array(); $i = 0; while ( list($ivr_id) = $sqlpt->sql_next_row($res) ) { $ivr_id_array[$i++] = $ivr_id; } for ( $i = 0; $i < count($ivr_id_array); $i++ ) { echo "<choice dtmf=\"" . $ivr_id_array[$i] . "\"" . " next=\"category_listing.php?ivr_lang_id=" . $ivr_id_array[$i] . "&is_cat=1&cat_id=0\"/>\n"; } ?> <!--######################END####################--> Then my application can not work. Can't I use the URI: category_listing.php?ivr_lang_id=" . $ivr_id_array[$i] . "&is_cat=1&cat_id=0 in the choose tag ?. Because in the next page (category_listing.php) I want to GET more than one variable. Please help me, thank you very much and sorry for my bad english. |
|
pacific_is_me
|
|
| Sorry because of making you misunderstood me :(. I just don't know how the server side script work with VoiceXML. Because if I use an URL like "www.my-domain.com/myfile.php?variable1=<argument1> in the "next element" of the choice tag then it work well, but when I use more than one variable like "www.my-domain.com/myfile.php?variable1=<argument1>&variable2=<argument2>", then VoiceXML can't recognize my URL. Is it some different from URL and URI ? please help me clarify this. Thanks. | |
mikethompson
|
|
| Hello Duong,
It's not that VoiceXML is not recognizing your URL when you use "www.my-domain.com/myfile.php?variable1=<argument1>&variable2=<argument2>". It's simply the & that is throwing a parse error. You need to escape the & by using & instead of plain old &. I went ahead and cooked up a little sample script for you that I have tested to work locally. You will notice it below, enjoy! Regards, Mike Thompson Voxeo Extreme Support ============Menu with Choice One============= <?xml version="1.0" encoding="UTF-8"?> <vxml version = "2.1"> <menu id="M_1"> <prompt> say choice one to test the choice element </prompt> <choice next="variable_puller.php?myvar1=foobarmania&myvar2=deliciousness"> choice one </choice> </menu> </vxml> ===========The PHP Variable Puller============ <?php //grab each variable $myvar1 = $_REQUEST["myvar1"]; $myvar2 = $_REQUEST["myvar2"]; echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; ?> <vxml version="2.1"> <form id="form_main"> <block> <prompt> This is a test. You should hear <?=$myvar1?>. Oh Snap. Did you hear <?=$myvar1?>. <break/> You should also hear <?=$myvar2?>. As in holy goodness, this dish is beyond <?=$myvar2?> </prompt> </block> </form> </vxml> |
|
pacific_is_me
|
|
| Oh, You're my angel :P, thank you very much. I'm appreciate your help. Thanks again. | |
kim69
|
|
| Hi I've got a problem where I have a mySQL database and a php web page and my voiceXML document posts variables that excutes a query where one then one result is found.
I can get it prompt the result of one them but how do I create it to prompt all of them? |
|
agonzalez
|
|
| well i know this is not a task but im pretty confused with the jsp explanation ill need 3 files to do this example work? first should be an "filename.xml" as this?
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE vxml PUBLIC "VoiceXML DTD" "C:\eclipse\plugins\com.hp.ocmp.vxml.cde.vxmlbinplugin_3.1.0.0TP1\dtd\w3c\vxml.dtd"> <vxml version = "2.1"> <var name="id" expr="session.callerid"/> <form> <block> <submit next="getdigits.jsp" namelist="id" method = "get"/> </block> </form> </vxml> getdigits.jsp should be as this? <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE vxml PUBLIC "VoiceXML DTD" "C:\eclipse\plugins\com.hp.ocmp.vxml.cde.vxmlbinplugin_3.1.0.0TP1\dtd\w3c\vxml.dtd"> <vxml version = "2.1"> <form id="form_Main"> <field name="digit1" type="digits?length=2"> <prompt bargein="false">Lets add two digit values together</prompt> <prompt>Please speak, or key in any two digit value</prompt> <filled> <log expr="'*** FILLED ***'"/> <log expr="'*** digit1 =' + digit1 + '***'"/> </filled> </field> <field name="digit2" type="digits?length=2"> <prompt bargein="false">Great.</prompt> <prompt>Now speak, or key in the second two digit value</prompt> <filled> <log expr="'*** FILLED ***'"/> <log expr="'*** digit2 =' + digit2 + '***'"/> <assign name="MyCallerID" expr="'<%=request.getParameter("id")%>'"/> <submit next="AddDigits.jsp" namelist="digit1 digit2 MyCallerID"/> </filled> </field> </form> </vxml> and AddDigits.jsp should be as this? <% int digit1 = 0; int digit2 = 0; try { //get int value for our digit1 digit1 = Integer.parseInt(request.getParameter("digit1")); } catch (Exception e) {} try { //get int value for digit2 digit2 = Integer.parseInt(request.getParameter("digit2")); } catch (Exception e) {} //get the sum of our digits int digitTotal = digit1 + digit2; //grab callerID from our submitted namelist String callerID = request.getParameter("MyCallerID"); %> <?xml version="1.0" encoding="UTF-8"?> <vxml version="2.1"> <form id="form_main"> <block> <prompt> <%=digit1%> plus <%=digit2%> equals <%=digitTotal%>. <break/> </prompt> <prompt> Just for kicks, let's count up to the total. <break/> <% for (int i = 0; i < digitTotal; ++i) { out.println( (i+1) + " mississippi" ); } %> <break/> </prompt> <prompt> See ya later, <say-as interpret-as="telephone"><%=CallerID%></say-as>. </prompt> </block> </form> </vxml> should be very clarifier if you get a link to 4 files os source code for asp jsp coldfusion and php it would be magic if you do that thank you for the support |
|
mikethompson
|
|
| Hey Kim,
I think that there might be some confusion that I should clear up regarding our abilities to offer support in this regard. Generally speaking, we don't offer too much in the way of support and debugging of server-side code; this would ential an enormous resource drain on our part, and would likely slow our support responses to a grinding halt. As we are an IVR provider, all that we are concerned with is the XML output of your code, and how it interacts with our voice gateway: http://docs.voxeo.com/voicexml/2.0/gettingsupport.htm Database queries, stored procedures, and functions on the server side is simply something that we cannot offer support for; even assuming that we did offer support for this, there would be no way that we could offer an accurate response to developer inquiries, as we don't have the database mappings, and have no way of recreating the code locally to test. As such, I think that your best course of action would be to search for assiatnce on this matter by visiting a PHP-specific site, (such as http://www.php.net), to see if you can find advice and support in this inquiry. Hope this helps, Mike Thompson Voxeo Extreme Support |
|
Michael.Book
|
|
| kim69,
Mike is right... Although we welcome our developers to discuss server-side topics as they related to CCXML/VoiceXML, PHP.net and/or other PHP user forums would really be your best bet for timely feedback on PHP specific questions. :-) But... What it sounds like you are trying to do is simply loop through multiple returns from your DB query..? You are using mysql_fetch_assoc() which is going to build an associative array containing each returned row. So, you can simply loop through the values, like so: --------------- <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml"> <form> <block> <?php while ($time = mysql_fetch_assoc($row_time)) { echo "<prompt> time is" . $time . "</prompt>"; } ?> </block> </form> <vxml/> --------------- Have Fun, ~ Michael |
|
Michael.Book
|
|
| agonzalez,
As the example shows, you only need two files to complete the operation... First, a client-side, VoiceXML document containing a field that gathers digits. Then you <submit> to a second, server-side, JSP document that grabs the needed parameters from the query-string, performs server-side logic, and dynamically outputs/returns VoiceXML. Viola! If I am misunderstanding your request, please do clarify. We will gladly assist... Cheers, ~ Michael |
|
agonzalez
|
|
| well as i was folowin' your example there were two diferent jsp files and in the first one in that you get the caller id from the querystring so that is cause another file is qettin' the session.callerid value and sending in a form with the get method so theres the third file well i haver fortunately got this example rolling as i posted in the last message so thanks for the support youre doing kindly well first file the one where you map you app has to be an xml? or could it be direclty a jsp extension with xml embedded | |
agonzalez
|
|
| sorry for the disturb and my low level skills i checked it does'nt matter the extension only the code inside the file | |
ryokan01
|
|
| Yes...yet another programming newbie here, so please forgive my ignorance (or at least don't laugh about it around the office).
Unless I am reading something wrong here, on the Voxeo development system it is NOT possible for me to pass a variable in a URL string and use it in my VXML document, correct? I am trying to pass through the name of an XML file ("orderid, in my case) to use for the application argument, but it seems as though I would need server-side scripting in order to do this. http://session.voxeo.net/VoiceXML.start?numbertodial=1234567890&tokenid=(tokenIDhere)&callerid=9876543210&orderid=1234 Then, in my VXML document I would have something like: <?xml version="1.0" encoding="UTF-8"?> <vxml version = "2.1" application=$orderid".xml"> This ain't gonna work, is it? |
|
MattHenry
|
|
|
Hi there, Most VXML platforms do not expose a way to capture querystring parameters without using a server-side markup, this is correct. In order to do anything of this nature, you will indeed need to code a "catcher" page using ASP/JSP/etc. Cheers, ~Matthew Henry |
|
hirennagar
|
|
| hi..guys need your help new to VXML....
Thanks for such a nice way to enable sharing of information. I want to be able to call an ASP page from .vxml file. I know howw to pass variables from .vxml to .asp. but I want to process the passed variables in the called .asp file and want to get them back in the .vxml file to present them to the user. I have gone through the examples on http://www.voicexmlguide.com/frame.jsp?page=qs_vars.htm there are two files with asp extensions: GetDigits.asp AddDigits.asp The GetDigits.asp file calls Adddigits.asp and then finally adddigits.asp file presents the data to user through voice. Both the asp files have .vxml embedded in them. "my question is that i am supossed to run these .asp files over asp server, will asp server support vxml and present the content through voice to the user ? " I am very much thankful to you for maintaining such a good place where people can share knowladge. |
|
jbassett
|
|
| Hello,
Thanks for all the positive feedback. To address your question. If you are using our free hosted environment for testing. You could host the embedded ASP files on your server, and then just Map the application URL(via our "Application Manager" tool) to that file. Our XML browsers will process all of the XML. Keep in mind that this is only because our free hosting environment does not support anything other than xXML, .wav, and .grammar extensions. Our production hosting can be modified to fit your needs and you could be given ASP support without having to host the files yourself. Second, you could always just download Prophecy and do all of the XML and ASP locally. I hope this answers your question. Thanks Jesse Bassett Voxeo Support |
|
sarika
|
|
| i am creating a voice survey application. For this application i need to store a vxml variable in a database. Am using mysql database here and embeding vxml code in php.
can some one help me out here to store data in database from the vxml document... |
|
mikethompson
|
|
| Hello Sarika,
Server-side troubleshooting is a bit beyond our scope of support. However, we would be more than happy to help you out with the VoiceXML portion of your application. It's actually quite easy to submit your VoiceXML variables off to a database, once your server-side page is ready to accept them. Here's a quick and dirty example on how to do that: <?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> You can see, the <submit> element is what you're looking for, where the next="" attribute should be the fully qualified URL of your server-side script. Hope this helps, Mike Thompson Voxeo Corporation |
|
danielvinson
|
|
| Hi
Could I use the 'submit' command to submit variables to a static php website such as www.txtlocal.com/sendsmspost.php for SMS purposes ? or do you need to submit them via an ASP, PHP, CF etc website. Thanks Regards Daniel |
|
VoxeoTony
|
|
| Hello Daniel,
For your question on if you can send variables to a static page using submit. You can send the variables to a static page or a server-side page if you choose. However, once the variable is sent the page that receives it will need to process it accordingly. As mentioned in the documentation, the ability to send delimited variables via namelist is a perk of using submit. In your posting you mention a site www.txtlocal.com/sendsmspost.php, and this is not a site that we are familiar with or support. Our recommendation would be to try out your theory and let us know if that site does support the ability to handle the variables being sent to it for your SMS testing. I'm sure the VoiceXML forum would gain from your feedback. Tony~ |
|
kave
|
|
| Hi,
I didn't get II parts of this, on JSP files, i have seen when the caller say or key the first and the second numbers you have specifed that it would be exactly 2 digits at least (type="digits?length=2") ? what would it happend if the caller key just one (digit per var)? also when i submit these variables to another JSP, automatically the server would response with this one (AddDigits.jsp)? thanks in avance, waiting for any answer Kave' |
|
jbassett
|
|
| Hello,
I will try and address your question as best I can. If you only keyed in one of the two digits the field is expecting, it will throw a nomatch event because the field is explicitly expecting two entries. If you did not enter anything at all it would throw a noinput and re prompt you. Let me know if you need any more info about this. Thanks, Jesse Bassett Voxeo Support |
|
kave
|
|
| Hi Jbassett, thanks for help me, maybe i wasn't clear about my question, ok... i know the field is expecting for 2 digits = digit1, i suppose that it is expecting for example on the field number one (digit1) = two chars, for example 3 and then 4 , digit1 = 34 isn't? also i'm still waiting for knowing about when you submit in the first JSP file you directly go through the second one? or the server sends the second JSP when the caller has said the digit1 and digit2 after submitting these vars?
thanks in avance have a nice day kave |
|
mikethompson
|
|
| Kave,
Yes, your understanding is correct regarding the digit input. As for your second question, I must apologize, but I don't quite understand what you're asking. Regardless, I will explain the JSP process for you: 1) Part 1 collects the two digits and callerID then sends them off to the second JSP page as parameters in the namelist. 2) Part 2 grabs the parameters from the resulting querystring and assigns them to JSP variables. 3) Math logic is performed to get the total of the digits and then the values are echoed in the VoiceXML Let me know if you have additional questions surrounding this, as I'm glad to help. Best, Mike Thompson Voxeo Corporation |
|
kave
|
|
| Hi Matt,
Now it's totally clear for me, i've understood, thanks for helping me out about these doubts, i'm developing a game app. by phone with JSP and VXML, and I thought that this tech (VXML) was implemented away from JSPs, like they should be separated , and now, i've seen that VXML is embedded in JSP pages. Jesse and you have been so kind to me, thanks a lot and any question about i'll let you know. Have a nice day and best regards Kave |
|
bradley.holt
|
|
| Perhaps you are trying to simplify things for the reader, but in the article you say, "The primary purpose of using POST is to hide our sensitive querystring data from prying eyes, and nosy neighbors." This is not the primary purpose of using POST. There is a more important difference between GET and POST. According to the HTTP specifications, GET requests should be idempotent. If you're simply reading a resource, use GET. If you're request will write data, make a change, or have some sort "side-effect" (that the user is requesting) then use POST. See <http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html> for more information. | |
koti
|
|
| Hi,
Iam developing IVR application in java, Spring Framework and TOMCAT server ..My basic step will invoke a jsp at http://67.12.10.20:8080/IVR/welcome.jsp, this will redirect to a Action Controller and the controller will forward the call to welcome.vxml file at /WEB-INF/welcome.vxml. I want the next to call getCallTreeFactory.jsp from welcome.vxml which is residing next to welcome.vxml. But it is searching out side of WEB-INF. How can i use the getCallTreeFactory.jsp from inside of WEB-INF. And how can i perform the action to invoke a Controller again from the getCallTreeFactory.jsp Please give me a sample exmaple on this. Thanks in advance koti |
|
MattHenry
|
|
|
Hi there Koti, I'm really sorry, but this question seems to be specific to the JSP markup, which is somewhat outside the bounds of what Voxeo offers direct application support for: the support team here is available to help address any vxml/cxml/ccxml inquiries that you might have, but for JSP/PHP/ASP sort of questions, these are really better suited to websites and forums dedicated to supporting these server-side markups. Best of luck, ~Matthew Henry |
|
mohamine
|
|
| hi
how to use the functions of php mysq_connect and mysql_select_db..... n the program voicexml. is what it necessite a configuration of prophecy or the call of a certain file thank you. |
|
mikethompson
|
|
| Hello,
I think that there might be some confusion that I should clear up regarding our abilities to offer support in this regard. Generally speaking, we don't offer too much in the way of support and debugging of server-side code; this would entail an enormous resource drain on our part, and would likely slow our support responses to a grinding halt. As we are an IVR provider, all that we are concerned with is the XML output of your code, and how it interacts with our voice gateway: http://docs.voxeo.com/voicexml/2.0/gettingsupport.htm Database queries, stored procedures, and functions on the server side is simply something that we cannot offer support for; even assuming that we did offer support for this, there would be no way that we could offer an accurate response to developer inquiries, as we don't have the database mappings, and have no way of recreating the code locally to test. The above examples were put in place to give our readers a basic understanding of how you can nest server-side scripting within VoiceXML. Beyond that, the subject matter gets thick quite quickly. As such, I think that your best course of action would be to search for assistance on this matter by visiting a PHP/SQL specific site (such as php.net), to see if you can find advice and support in this inquiry. Best, Mike Thompson Voxeo Corporation |
|
winravi
|
|
| Hi Sir,
From the above sample; GetDigits.jsp and AddDigits.jsp ; Since the Voxeo hosting Server will not support any Server-Side scripting like a JSP; how to test the above sample; Assuming I have a tomcat 6.x environment and using your Voxeo Hosting Services; or Netbeans GlassFish Server 6.x: Where/How do I place the files in Voxeo Application Manager generate to Application calling number Thanks in advance for your knowledge sharing |
|
mikethompson
|
|
| Hello,
Our voice browsers work just like a web-browser, in the sense it simply fetches URLs, and processes the output. This being said, if you have a web-server on your end which supports PHP, simply host your application document on there, then place its URL in your Application Manager as the Start URL for your application mapping. For more information, check out our Quick start guide: https://evolution.voxeo.com/docs/quickStart.jsp Hope this helps, Mike Thompson Voxeo Corporation |
|
winravi
|
|
| Thanks Mike; got this sample done - I need more help - will come back soon, Ravi | |
azeta_ambrose
|
|
| Thanks Voxeo,
I was able to send data through voice/phone to mysql database using php code. The tutorial was of great help. But i have problems retrieving data from the same mysql using php code to my phone. Maybe someone can volunteer to assist. Ambrose |
|
mikethompson
|
|
| Hello,
I think that there might be some confusion that I should clear up regarding our abilities to offer support in this regard. Generally speaking, we don't offer too much in the way of support and debugging of server-side code; this would entail an enormous resource drain on our part, and would likely slow our support responses to a grinding halt. As we are an IVR provider, all that we are concerned with is the XML output of your code, and how it interacts with our voice gateway: http://docs.voxeo.com/voicexml/2.0/gettingsupport.htm Database queries, stored procedures, and functions on the server side is simply something that we cannot offer support for; even assuming that we did offer support for this, there would be no way that we could offer an accurate response to developer inquiries, as we don't have the database mappings, and have no way of recreating the code locally to test. As such, I think that your best course of action would be to search for assiatnce on this matter by visiting a PHP-specific site, (such as http://www.php.net), to see if you can find advice and support in this inquiry. Best, Mike Thompson Voxeo Corporation |
|
azeta_ambrose
|
|
| Hello voxeo.
Thanks for all the support. I just like to know if your platform support database queries? I have been having some problems for over 2 weeks trying to post or retrieve from mysql database using php. I have tried submit and data/cdata statement but i keep getting either "this application have an internal error or error in the gateway software" Here is my vxml and php code. Normally, I write php/mysql applications for other projects, but I can simplying integrate it with vxml using this platform. I have already upload my php files and mysql database to a web server, which my submit/data statement put to. Please a member of the forum may offer to assist me, probably with some sample code. Thanks to you all in advance. vmlx code ========= <vxml version = "2.1"> <meta name="maintainer" content="YOUREMAILADDRESS@HERE.com"/> <form id="MainMenu"> <field name="uname"> <prompt> user name. </prompt> <grammar type="text/gsl"> [cartman phillip] </grammar> <noinput> no user name. <reprompt/> </noinput> <nomatch> name not recognized. <reprompt/> </nomatch> </field> <field name="pword"> <prompt> password. </prompt> <grammar type="text/gsl"> [big hat] </grammar> <noinput> no password. <reprompt/> </noinput> <nomatch> password not recognized. <reprompt/> </nomatch> </field> <filled> <submit next="http://www.autosp.byethost13.com/am6.php" method="get" namelist = "=uname pword"/> </filled> </form> </vxml> php coe ======= <?php include "connect.php"; $myvar1 = $_REQUEST["uname"]; $myvar2 = $_REQUEST["pword"]; echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; $query = "insert into paper1 set userid = \"$myvar1\", passwd = \"$myvar2\""; $result = mysql_query($query) or die('<br><br><center> <?=OUT?> </center>'); ?> Thanks. Ambrose |
|
VoxeoDustin
|
|
| Hey Ambrose,
This is certainly possible, as pretty much anything you can do with server side is as long as what is returned is valid. In the case of <submit>, you will need to return a valid VoiceXML document, as the browser will transition to the document and attempt to parse it. For <data>, it's more of a 'fire and forget' function, but will expect the return to be valid XML data. I recommend sticking with submit for this case, as accessing the data will likely be easier. Hope this helps, Dustin |
|
hsc
|
|
| hi, sorry if this is a really silly question.
Im trying to access a sql database via jsp in a vxml document. how exactly do i run the jsp code to parse the information and does anyone have a clue what the jsp code would be? |
|
ricarjos
|
|
| Hi,
mmm.php <?php $db = mysql_connect("localhost", "xxxxx", "xxxxxx"); mysql_select_db("xxxx",$db); $result = mysql_query("SELECT * FROM prop ",$db); $myrow = mysql_fetch_array($result); $Nintentos = $myrow['Nintentos']; mysql_close($db); ?> I've this code in my server (usuarios.lycos.es) i need send the variable $Nintentos to an application in vxml, I need this variable to decide how action do it. For example, if $Nintentos = 1 the application play MySoundFile1 with <audio src="MySoundFile1.wav"/>, but if $Nintentos = 2 the application play MySoundFile2 with <audio src="MySoundFile2.wav"/>. Please help me is very necesary for i finish my application, it's urgent. Ricardo |
|
VoxeoDustin
|
|
| Hey Ricardo,
This is pretty simple, as integrating server side into your voice apps is simple as long as the output is valid VoiceXML. Using the code above, you could simply do something like: <audio src="MySoundFile<%php echo $Nintento%>.wav"/> Cheers, Dustin |
|
ricarjos
|
|
| Hi, thanks for your quickly answer, but I believe that i expresse bad my example, the problem is that them name of the archives to reproduce is going to be very different, nonsingle will change the number, and in addition I don't know if is my bad English, but I'm not understood in that place I must put the audio element, this goes in the file .xml or in file .php?
Thanks for your help. Ricardo |
|
VoxeoDustin
|
|
| Hey Ricardo,
You'll want to fetch your PHP document via the <submit> attribute. This will transition control to this document. As long as the output of the document is valid VoiceXML, any PHP will be processed and the VXML browser will execute the VXML content. By doing this, we can basically use PHP to echo any strings we want back to the VXML that will be output when this document is fetched. Below is basic sample based on the code you provided. <!-- Initial VXML document performs a <submit> and fetches this PHP doc --> <?php $db = mysql_connect("localhost", "xxxxx", "xxxxxx"); mysql_select_db("xxxx",$db); $result = mysql_query("SELECT * FROM prop ",$db); $myrow = mysql_fetch_array($result); $Nintentos = $myrow['Nintentos']; mysql_close($db); ?><?xml version="1.0"?> <vxml version="2.1"> <form> <block> <audio src="<%php echo $Nintentos%>"/> </block> </form> </vxml> http://docs.voxeo.com/voicexml/2.0/intro_serverside.htm Cheers, Dustin |
|
dki123
|
|
| Hi,
can I assign value of VXMl variable to JSP variable (or any server side script variable, for that matter), when I have only single JSP page? I dont want to submit vxml variables to another JSP page and to be collected through request.getParameter(). Thanking you in advance. |
|
voxeoJeffK
|
|
| Hi,
I'm not sure you'll be able to do that, but I'd like to get clarification. Do you mean that the initial request will be accepted by your jsp page which outputs the VXML. Then you want to share data from the running VXML session? Please let us know if I am understanding properly. Regards, Jeff K. |
|
dki123
|
|
| Yes Jeff,
The same way which you understood. Initial request 'll be accepted by jsp page having VXML tags to take input into some VXML variables and then storing those values into jsp variables. Please let me know if you need further clarification. Thanks for you prompt reply. |
|
VoxeoDustin
|
|
| Hey,
Unfortunately, there is no way to assign the value of a VXML variable to a server side variable without submitting this value via submit. As the server side is parsed at runtime and sent to the VXML browser as a static VXML file, there is no way to pass this value back to the server side without submitting a new request. Let me know if we can be of further assistance. Cheers, Dustin |
|
sudhareddy
|
|
| Hi
I am new to vxml..my requirement is i want to store user response in a variable and i want to send those variable to my aspx page..how we can achive this... for ex: computer: What is your name? user :xyz computer:what is ur phone number? user:9999999999 i want to store name and phone number and i want to use those to in my aspx page |
|
voxeoAlexBring
|
|
| Hello,
Assigning user input to a variable in voiceXML is very simple, and actually has some handy built in input handling. When you make a [url=http://docs.voxeo.com/voicexml/2.0/field.htm]<field>[/url] you can add [code]name="foo"[/code] to it and it will automatically fill the specified variable with input from a specified grammar. Once the user has matched an utterance from the grammar you can use a [url=http://docs.voxeo.com/voicexml/2.0/filled.htm]<filled>[/url] to activate a [url=http://docs.voxeo.com/voicexml/2.0/submit.htm]<submit>[/url] element to send any information in the variable to another document of your choice. I have supplied some sample code below to give you a head start for using these elements. [code]<form> <field name="foo"> <prompt> What is your name? </prompt> <grammar type="text/gsl"> <![CDATA[[ (?name one) (?name two) (?name three) ]]]> </grammar> </field> <filled namelist="foo"> <submit next="mysamplepage.php" namelist="foo" method="post"/> </filled> </form>[/code] If you have any other questions, comments, or concerns please let us know and we will be happy to assist you! Regards, Alex Voxeo Support |
|
sudhareddy
|
|
| Hello Alex thanx for replay..but i don't want to mention the names like one,two,three..whatever user says that name i want to store..
|
|
voxeoAlexBring
|
|
| Hello again,
Unfortunately due to limitations of how grammars work you need to have a specified list of names for the user to say. However we do offer support for the TARGUS service, which runs an additional fee for the feature. We would be happy to explore this further with you if you are interested in this service. Regards, Alex Voxeo Support |
|
sudhareddy
|
|
| Thanx again Alex...
sorry i didn't get that "TARGUS service".....and is there any other way to store user response...is it possible through "record" element........ |
|
voxeoAlexBring
|
|
| Hello,
First off, the [code]<record>[/code] element is used to record audio from the call and can not assign a value to a variable based on the recorded audio, but you can send that audio to your server if you would like. Targus is an extra service that allows you to collect name and address information from your callers in your voiceXML application. Regards, Alex Voxeo Support |
|
sudhareddy
|
|
| hello
<filled namelist="foo"> <submit next="http://localhost:1305/Vxml/Default.aspx" namelist="foo" method="post"/> My Requirement is i want to send that 'foo' variable from vxml to my aspx page how we can achieve this...If i am using like above code it is giving URL not found error...but that URL is correct..if i open that URL in my browser it is working properly... |
|
voxeoAlexBring
|
|
| Hello again,
Your code is correct, however the URL you are trying to use is located on your local computer. If you are trying to hit a file with your application you should make sure that the file is located on a web based server, as the application can not find your file with a "http://localhost" file path, because the file your trying to hit is not located on our local computers :) For a little deeper explanation: Localhost is a file path that leads to 127.0.0.1, which is not a routable address for our applications. When referring to a file from an application you need to point it to a file that contains a visible IP address or host name. If you have any other questions we can help you with please let us know. Regards, Alex Voxeo Support |
|
sudhareddy
|
|
| Hello Alex...
I am using following code it is giving search request timed out... <filled namelist="foo"> <submit next="http://203.187.249.94:1305/Vxml/Default.aspx" namelist="foo" method="post"/> |
|
voxeoJeffK
|
|
| Hi,
The URL: http://203.187.249.94:1305/Vxml/Default.aspx does not fetch. You may be behind a firewall, and need to open access to that port. Regards, Jeff K. |
|
louie
|
|
| Hi,
I've encountered an issue with the following vxml code, it seems to me that the <submit> portion of the code never execute, since I have the servlet set up and running on apache tomcat 6.0, I know that there is no problem with servlet code, it works if I execute the following url from the web browser, but couldn't invoked it from the vxml code, just wonder what is the problem? http://172.30.112.10:8080/ConferenceCall/servlet/ConfCallServlet?confid=2000&usertype=3&guid=43ddere3344 -------------------------------------------- <?xml version="1.0" encoding="ISO-8859-1"> <vxml version="2.0"> <var name="guid" expr=""/> <var name="confid" expr=""/> <var name="usertype" expr=""/> <form id="transfer"> <transfer name="call" dest="<?= $dialled ?>" bridge="<?= $bridge ?>" connecttimeout="15s"> <filled> <if cond="call == 'busy'"> <prompt><audio src="<?= $busy_file ?>"> Sorry, number is busy, please call back later.</audio><break time="3s"/></prompt> <disconnect/> <elseif cond="call == 'noanswer'"/> <prompt><audio src="<?= $noanswer_file ?>"> Sorry, there was no answer, please call back later.</audio><break time="3s"/></prompt> <disconnect/> <elseif cond="call == 'far_end_disconnect'"/> <prompt><audio src="<?= $hungup_file ?>"> The called party has hung up.</audio><break time="3s"/></prompt> <disconnect/> <elseif cond="call == 'near_end_disconnect'"/> <prompt><audio src="<?= $near_end_disc_file ?>"> You have pressed 1 to disconnect the transfer. </audio><break time="3s"/></prompt> <disconnect/> <elseif cond="call == 'maxtime.disconnect'"/> <prompt><audio src="<?= $maxtime_disc_file ?>"> Your call ran over the maxtime of sixty seconds,and the called party has been disconnected. </audio><break time="3s"/></prompt> <disconnect/> <elseif cond="call == 'unknown'"/> <prompt><audio src="<?= $unknown_file ?>"> Sorry, due to technical difficulties, we can't transfer your call to the operator; please call back later. </audio><break time="3s"/></prompt> <disconnect/> <else/> <assign name="confid" expr="2000"/> <assign name="usertype" expr="3"/> <assign name="guid" expr="43ddere3344"/> <submit next="http://172.30.112.10:8080/ConferenceCall/servlet/ConfCallServlet" namelist="confid usertype guid"/> </if> </filled> </transfer> </form> </vxml> ----------------- Louie |
|
voxeoJeffK
|
|
| Hi,
The <submit> lies with the <transfer>'s <filled> element after a catch-all <else>. This means the <submit> will never occur since it can only fire after an event you haven't handled: error.connection.noauthorization error.connection.baddestination error.unsupported.transfer.blind network_busy If you want the <submit> to fire after the <transfer> action is over just put it after the transfer. </if> </filled> </transfer> <submit next="http://172.30.112.10:8080/ConferenceCall/servlet/ConfCallServlet" namelist="confid usertype guid"/> </form> </vxml> hope that helps, Jeff K. |
|
louie
|
|
| Hi,
I've moved the <submit> after the end of </tranfer> as suggested, however it given me the following parse error: |DocumentParser::FetchDocument - Parse error in file "transfer.php? Element 'submit' is not valid for content model: '(dtmf|grammar|catch|help|noinput|nomatch|error|filled|initial|object|link|property|record|subdialog|transfer|block|field|var)*' Just wonder is this the correct syntax? </if> </filled> </transfer> <submit next="http://172.30.112.10:8080/ConferenceCall/servlet/ConfCallServlet" namelist="confid usertype guid"/> </form> </vxml> Looks the the parent of the <submit> is <block> <catch> <error> <filled> <help> <if>, and doesn't include <form>, how can I resolve this issue? |
|
voxeojeff
|
|
| Hi there,
To get around this problem, you can put your submit in a block, like so: </transfer> <block> <submit next="http://172.30.112.10:8080/ConferenceCall/servlet/ConfCallServlet" namelist="confid usertype guid"/> </block> </form> </vxml> This should allow you to properly submit after the transfer completes. Hope this helps, Jeff |
|
louie
|
|
| Thanks for the suggestion, after some testing, I've found the servlet could not be invoked, if it wasn't outputing or returning a vxml file. Since I plan to use the servlet to log information to database. Why does the servlet has to return back a vxml file? Is there way around this by not return anything at all? | |
voxeoJeffK
|
|
| Hi,
Not returning anything at all would just result in a fetch timeout because the browser is waiting for something to execute. Also remember there is a CCXML wrapper running the dialog to begin with. An explicit exit is just good coding practice. The return can be even something as simple as: <?xml version="1.0" encoding="UTF-8"?> <vxml version = "2.1"> <form id="MyForm"> <exit/> </form> </vxml> |
|
MattHenry
|
|
|
Hi Louie, Note that you can also leverage the <data> element as a sort of fire-and-forget submit element, where the target document doesn't output any VXML at all. Do note that the target page must output xml in some capacity, which can simply be an <xml> declaration and a closing <xml> tag. You can see an example of this in action in our VXML tutorials: http://docs.voxeo.com/voicexml/2.0/t_17mot.htm ~Matt |
|
louie
|
|
| Hi Jeff,
After change the servlet to output the vxml per your suggestion, however I still couldn't get the vxml to invoke the servlet; I've test it by invoking other servlet before the transfer, the servlet can return back vxml, I suspect it is the <transfer> that cause the problem, any suggestion on how to solve this issue? Also, I am using a 2.0 vxml browser platform, can't test the <data> element suggested by Matt, just wonder is there other way to do a fire and forget? <?xml version="1.0" encoding="ISO-8859-1"> <vxml version="2.0"> <var name="guid" expr=""/> <var name="confid" expr=""/> <var name="usertype" expr=""/> <form id="transfer"> <transfer name="call" dest="<?= $dialled ?>" bridge="<?= $bridge ?>" connecttimeout="15s"> <filled> <assign name="confid" expr="2000"/> <assign name="usertype" expr="3"/> <assign name="guid" expr="43ddere3344"/> </filled> </transfer> <block> <submit next="http://172.30.112.10:8080/ConferenceCall/servlet/ConfCallServlet" namelist="confid usertype guid"/> </block> </form> </vxml> Regards, Louie |
|
VoxeoDustin
|
|
| Hey Louie,
Unfortunately, I don't believe that we can be of much assistance with another platform. In order to determine the cause, I would need to see logs of a failed call, and I am not particularly versed in debugging VXML platforms outside of Prophecy. The <data> element was an addition to 2.1 and is really the only way to send a request without transitioning to the called document. Let me know if we can be of further assistance. Cheers, Dustin |
| login |
|