| VoiceXML 2.1 Development Guide | Home | Frameset Home |
|
| ANNOTATIONS: EXISTING POSTS |
moshe
|
|
| Variables that are passed to VoiceXML scripts can't be accessed using the script alone. For example, if a CCXML calls a VoiceXML script using <dialogstart namelist="foo"/>, the VoiceXML script simply will not see "foo." That's because "foo" is part of the URL and is not passed into the script.
To access a variable passed to a VoiceXML script via a CCXML <dialogstart>, a VoiceXML <submit>, or some other method, you have to use server-side tricks. That is, you have to use some server-side interpreter that alters the VoiceXML script, such as PHP or CGI. See http://www.voicexmlguide.com/qs_vars.htm for details. |
|
mikethompson
|
|
| Hey Moshe,
You will undoubtedly be glad to hear this... There is a way to get access to the CCXML dialogstart ("namelist") variables. They are made available in the VoiceXML 'session.connection.ccxml' name space, as defined in 'http://www.w3.org/TR/2005/WD-ccxml-20050629/#VoiceXMLIntegration'. In other words, we can now access CCXML namelist vars passed to a VoiceXML dialog without server-side scripting. An example application demonstrating how to accesses all values in the 'session.connection.ccxml' object is: __________________________________ <?xml version="1.0" encoding="UTF-8" ?> <vxml version="2.1" xmlns:voxeo="http://community.voxeo.com/xmlns/ vxml"> <form id="CCXMLVars"> <block> <log expr="'session.connection.ccxml == ' + session.connection.ccxml"/> <log expr="'session.connection.ccxml.sessionid == ' + session.connection.ccxml.sessionid"/> <log expr="'session.connection.ccxml.dialogid == ' + session.connection.ccxml.dialogid"/> <log expr="'session.connection.ccxml._ioprocessors == ' + session.connection.ccxml._ioprocessors"/> <log expr="'session.connection.ccxml._ioprocessors.basichttp == ' + session.connection.ccxml._ioprocessors.basichttp"/> <log expr="'session.connection.ccxml._url == ' + session.connection.ccxml._url"/> <log expr="'session.connection.ccxml.namelist == ' + session.connection.ccxml.namelist"/> <log expr="'session.connection.ccxml.namelist.length == ' + session.connection.ccxml.namelist.length"/> <foreach item="value" array="session.connection.ccxml.namelist"> <log expr="'foreach keys == ' + value"/> </foreach> <log expr="'session.connection.ccxml.values == ' + session.connection.ccxml.values"/> <log expr="'session.connection.ccxml.values.a == ' + session.connection.ccxml.values.a"/> <log expr="'session.connection.ccxml.values.b == ' + session.connection.ccxml.values.b"/> <log expr="'session.connection.ccxml.values.c == ' + session.connection.ccxml.values.c"/> <log expr="'session.connection.ccxml.values.d == ' + session.connection.ccxml.values.d"/> </block> </form> </vxml> __________________________________ Hope this helps, Mike Thompson Voxeo Extreme Support |
|
moshe
|
|
| Excellent improvement!
Now, for a bonus comment -- this doesn't seem to be documented Appendix H under the W3C properties. |
|
MattHenry
|
|
|
Hiya Moshe, I'm not sure what it is that you are saying here...are you referring to the session variables not being listed in the VXML docs? Assuming that I am interpreting you correctly, I'd think that I can add this to our "VoiceXML variables" section of the documentation, or perhaps even include this code sample as part of a full-blown tutorial in both the VXML and CCXML docsets. ~Matt |
| login |
|