The Microsoft.Rtc.Collaboration.AudioVideo.VoiceXml.Browser object in C# has a RunAsync method that takes a URI of a Vxml page to run and a CookieCollection that should, in theory, allow you to pass in parameters that can be used within the script. I've tried every conceivable method I can think of of getting cookies from the Vxml, and there do not seem to be any attached to the document. Any ideas on how to access the passed-in cookies from the Vxml?
At its simplist, this is what I had as the vxml:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 2.0//EN" "http://cafe.bevocal.com/libraries/dtd/vxml2-0-bevocal.dtd">
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml" xml:lang="en-US" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/vxml http://www.w3.org/TR/voicexml21/vxml.xsd" >
<form id="QueueForm">
<script>
<![CDATA[
function GetCookie(name)
{
var cookies = document.cookie;
return cookies;
}
]]>
</script>
<var name="cookie" expr="GetCookie('')" />
<field name="QueueField">
<prompt>
<value expr="cookie" />
were cookies
</prompt>
<grammar mode="dtmf" root="Dtmf">
<rule id="Dtmf">
<one-of>
<item> 1 </item>
</one-of>
</rule>
</grammar>
<filled>
<exit namelist="cookie"/>
</filled>
</field>
</form>
</vxml>
And this in the calling code
_browser.SetAudioVideoCall(_call);
System.Net.CookieContainer cookies = new System.Net.CookieContainer(1);
cookies.Add(new System.Net.Cookie("data", "grapefruit", "/", "localhost"));
_browser.Run(_startPage, cookies);
...which results in a spoken "Were cookies." in all instances I tried.
I've tried setting different domains and paths on the cookie object, calling different Javascript objects to get the cookie different ways and anything else I could think of, but haven't been able to access the cookie. The Microsoft sample projects for Vxml also do not contain an example of accessing cookies. I'm sure there's a way to access the items that are passed in, but I haven't been able to figure out how; any thoughts?