Make no mistake, using the new VoiceXML 2.1 <data> element to fetch an XML document that can be utilized from within a VoiceXML script without a page transition is indeed handy. But there isn’t any asynchronous communication happening here â€“ the external XML document is fetched only once, typically at the begining of script execution. For asynchronous behavior, we need to look to one of VoiceXML’s sister technologies â€“ the Call Control eXtensible Markup Language (CCXML).
The CCXML 1.0 specification (a last call working draft from the W3C) includes the <send> element, which allows a developer to throw a user defined event that can be caught by the initiating (or another) CCXML document. The classic <send> example involves the throwing of a â€œtimesUpâ€ event that allows a developer to designate when a call should be terminated.
The good folks at Voxeo (leaders in the effort to formalize the CCXML standard) have added functionality to their platform that allows the <send> element to asynchronously send and receive information via HTTP. So its theoretically possible to construct a conference call application that sends a message to a back end script to kick off an IM message to the call organizer when there are 30 seconds left on the call. (Actually, that sounds pretty cool â€“ may have to try that one soon.)
When it comes to AJAX in VoiceXML, the same functionality is generally available but the needs of developers are somewhat different. Callers to a VoiceXML application probably donâ€™t perceive page transitions in the same way that users of a visual web application do. VoiceXML has fetching and caching functionality built into it that can be used to manage the delay between page transitions. It’s probably a better use of developer time to understand fetching and caching more intimately than to try and replicate AJAX in voice applications.