Response XML processing
Posted: Wed Sep 30, 2009 10:10 am
Hello,
I'm working on a simple application and while I can mimic the behavior in a HTML page, when I use similar javascript in a vxml document, I don't seem to get any results.
The application code is the following.
<?xml version="1.0"?>
<vxml version="2.0">
<var name="appkey" expr="'3309B8E6-38D2-315F-A06C-9D7F6129150F'"/>
<var name="display" expr="2"/>
<var name="searchradius" expr="'10|25|50|100'" />
<var name="provider" expr="'vxml'"/>
<var name="loc_idx" expr="0" />
<var name="locations" />
<var name="geoLocs" />
<property name="interdigittimeout" value="3s" />
<property name="maxage" value="10s" />
<script maxage="1s" maxstale="1s" src="http://ivr.where2getit.com/chickfila/ivr/vxml.js" />
<form id="getinput">
<field name="address" type="digits?length=5">
<prompt>
Please enter a five digit zip code
</prompt>
<catch event="nomatch noinput">
I'm sorry, but that is not a valid five digit zip code.
<reprompt/>
</catch>
<filled>
<data namelist="appkey searchradius provider address" name="geoLocs" src="http://ivr.where2getit.com/lite?action=locatorsearch" />
<assign name="document.locations" expr="updateFromResponseXML(geoLocs)" />
<goto next="#results" />
</filled>
</field>
</form>
<form id="results">
<block>
<foreach item="location" array="document.locations">
<log expr="'***** LOCATION DETAIL ' + location.address1" />
</foreach>
</block>
</form>
</vxml>
The 'updateFromResponseXML' I can mimic on this web page, hosted.where2getit.com/chickfila/ivr.html. If you have firebug installed you can single step through the function and see the result array that is returned so I'm confident that it is processing the xml correctly.
If you paste the url from the request generated in the vxml document into your browser, you can see the xml response it gets.
http://ivr.where2getit.com/lite?action= ... ress=92807
The call log detail looks like the following. Since nothing in the foreach loop is executed, I assume that the 'locations' array is empty.
d 30 Sep 2009 11:03:45 AM EDT:
Call Start Event: ANII 2242325546 DNIS 3999 VURL http://us.popproxy.plumgroup.com/plumvp/demo.php
DocumentParser::FetchDocument()
DocumentParser::FetchDocument(http://us.popproxy.plumgroup.com/plumvp/demo.php)
Cache Miss: http://us.popproxy.plumgroup.com/plumvp/demo.php
Attempting to fetch http://us.popproxy.plumgroup.com/plumvp/demo.php
Loading Builtin grammar: builtin:grammar/digits
Loading Builtin grammar: builtin:dtmf/digits
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF VOICE"
Cache Hit: http://us.popproxy.plumgroup.com/plumvp/audio/demo.wav
Audio segment from the URL audio/demo.wav added to prompt queue
VXI::field_element - activating grammars for form = '$_internalName_161882' formitem = 'ext'
VXI::do_recognition()
PromptManager::Play()
Newly queued prompts are now being played
Wed 30 Sep 2009 11:03:51 AM EDT:
dtmf input: 1892
Found grammar match
hypothesis #0: 1892 (0.9990)
VXI::var_element(name="session_id" expr = "session.id")
VXI::var_element(name="dnis" expr = "session.telephone.dnis")
DocumentParser::FetchDocument(demo.php)
Posted form data is URL encoded
Attempting to fetch http://us.popproxy.plumgroup.com/plumvp/demo.php
DocumentParser::FetchDocument(scratchpad.php/jscarbrough%40where2getit.com/test3)
Cache Miss: http://us.popproxy.plumgroup.com/plumvp ... .com/test3
Attempting to fetch http://us.popproxy.plumgroup.com/plumvp ... .com/test3
Loading Builtin grammar: builtin:grammar/digits?length=5
Loading Builtin grammar: builtin:dtmf/digits?length=5
VXI::var_element(name="appkey" expr = "'3309B8E6-38D2-315F-A06C-9D7F6129150F'")
VXI::var_element(name="display" expr = "2")
VXI::var_element(name="searchradius" expr = "'10|25|50|100'")
VXI::var_element(name="provider" expr = "'vxml'")
VXI::var_element(name="loc_idx" expr = "0")
VXI::var_element(name="locations" expr = "")
VXI::var_element(name="geoLocs" expr = "")
Cache Miss: http://ivr.where2getit.com/chickfila/ivr/vxml.js
Attempting to fetch http://ivr.where2getit.com/chickfila/ivr/vxml.js
VXI::var_element(name="appkey" expr = "'3309B8E6-38D2-315F-A06C-9D7F6129150F'")
VXI::var_element(name="display" expr = "2")
VXI::var_element(name="searchradius" expr = "'10|25|50|100'")
VXI::var_element(name="provider" expr = "'vxml'")
VXI::var_element(name="loc_idx" expr = "0")
VXI::var_element(name="locations" expr = "")
VXI::var_element(name="geoLocs" expr = "")
Cache Hit: http://ivr.where2getit.com/chickfila/ivr/vxml.js
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF VOICE"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>
Please enter a five digit zip code to find the closest restaurant location
</speak>
---------
VXI::field_element - activating grammars for form = 'getinput' formitem = 'address'
VXI::do_recognition()
PromptManager::Play()
Newly queued prompts are now being played
Wed 30 Sep 2009 11:03:57 AM EDT:
dtmf input: 92807#
Found grammar match
hypothesis #0: 92807 (0.9990)
Cache Miss: http://ivr.where2getit.com/lite?action= ... 7c50%7c100
Attempting to fetch http://ivr.where2getit.com/lite?action= ... 7c50%7c100
VXI::assign_element(name="document.locations" expr = "updateFromResponseXML(geoLocs)")
VXI::foreach_element()
received event: connection.disconnect.hangup:
VXI::exit_element()
Call End Event
Ending session
Ending Session On Channel 17
Thank you.
Jon
I'm working on a simple application and while I can mimic the behavior in a HTML page, when I use similar javascript in a vxml document, I don't seem to get any results.
The application code is the following.
<?xml version="1.0"?>
<vxml version="2.0">
<var name="appkey" expr="'3309B8E6-38D2-315F-A06C-9D7F6129150F'"/>
<var name="display" expr="2"/>
<var name="searchradius" expr="'10|25|50|100'" />
<var name="provider" expr="'vxml'"/>
<var name="loc_idx" expr="0" />
<var name="locations" />
<var name="geoLocs" />
<property name="interdigittimeout" value="3s" />
<property name="maxage" value="10s" />
<script maxage="1s" maxstale="1s" src="http://ivr.where2getit.com/chickfila/ivr/vxml.js" />
<form id="getinput">
<field name="address" type="digits?length=5">
<prompt>
Please enter a five digit zip code
</prompt>
<catch event="nomatch noinput">
I'm sorry, but that is not a valid five digit zip code.
<reprompt/>
</catch>
<filled>
<data namelist="appkey searchradius provider address" name="geoLocs" src="http://ivr.where2getit.com/lite?action=locatorsearch" />
<assign name="document.locations" expr="updateFromResponseXML(geoLocs)" />
<goto next="#results" />
</filled>
</field>
</form>
<form id="results">
<block>
<foreach item="location" array="document.locations">
<log expr="'***** LOCATION DETAIL ' + location.address1" />
</foreach>
</block>
</form>
</vxml>
The 'updateFromResponseXML' I can mimic on this web page, hosted.where2getit.com/chickfila/ivr.html. If you have firebug installed you can single step through the function and see the result array that is returned so I'm confident that it is processing the xml correctly.
If you paste the url from the request generated in the vxml document into your browser, you can see the xml response it gets.
http://ivr.where2getit.com/lite?action= ... ress=92807
The call log detail looks like the following. Since nothing in the foreach loop is executed, I assume that the 'locations' array is empty.
d 30 Sep 2009 11:03:45 AM EDT:
Call Start Event: ANII 2242325546 DNIS 3999 VURL http://us.popproxy.plumgroup.com/plumvp/demo.php
DocumentParser::FetchDocument()
DocumentParser::FetchDocument(http://us.popproxy.plumgroup.com/plumvp/demo.php)
Cache Miss: http://us.popproxy.plumgroup.com/plumvp/demo.php
Attempting to fetch http://us.popproxy.plumgroup.com/plumvp/demo.php
Loading Builtin grammar: builtin:grammar/digits
Loading Builtin grammar: builtin:dtmf/digits
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF VOICE"
Cache Hit: http://us.popproxy.plumgroup.com/plumvp/audio/demo.wav
Audio segment from the URL audio/demo.wav added to prompt queue
VXI::field_element - activating grammars for form = '$_internalName_161882' formitem = 'ext'
VXI::do_recognition()
PromptManager::Play()
Newly queued prompts are now being played
Wed 30 Sep 2009 11:03:51 AM EDT:
dtmf input: 1892
Found grammar match
hypothesis #0: 1892 (0.9990)
VXI::var_element(name="session_id" expr = "session.id")
VXI::var_element(name="dnis" expr = "session.telephone.dnis")
DocumentParser::FetchDocument(demo.php)
Posted form data is URL encoded
Attempting to fetch http://us.popproxy.plumgroup.com/plumvp/demo.php
DocumentParser::FetchDocument(scratchpad.php/jscarbrough%40where2getit.com/test3)
Cache Miss: http://us.popproxy.plumgroup.com/plumvp ... .com/test3
Attempting to fetch http://us.popproxy.plumgroup.com/plumvp ... .com/test3
Loading Builtin grammar: builtin:grammar/digits?length=5
Loading Builtin grammar: builtin:dtmf/digits?length=5
VXI::var_element(name="appkey" expr = "'3309B8E6-38D2-315F-A06C-9D7F6129150F'")
VXI::var_element(name="display" expr = "2")
VXI::var_element(name="searchradius" expr = "'10|25|50|100'")
VXI::var_element(name="provider" expr = "'vxml'")
VXI::var_element(name="loc_idx" expr = "0")
VXI::var_element(name="locations" expr = "")
VXI::var_element(name="geoLocs" expr = "")
Cache Miss: http://ivr.where2getit.com/chickfila/ivr/vxml.js
Attempting to fetch http://ivr.where2getit.com/chickfila/ivr/vxml.js
VXI::var_element(name="appkey" expr = "'3309B8E6-38D2-315F-A06C-9D7F6129150F'")
VXI::var_element(name="display" expr = "2")
VXI::var_element(name="searchradius" expr = "'10|25|50|100'")
VXI::var_element(name="provider" expr = "'vxml'")
VXI::var_element(name="loc_idx" expr = "0")
VXI::var_element(name="locations" expr = "")
VXI::var_element(name="geoLocs" expr = "")
Cache Hit: http://ivr.where2getit.com/chickfila/ivr/vxml.js
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF VOICE"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>
Please enter a five digit zip code to find the closest restaurant location
</speak>
---------
VXI::field_element - activating grammars for form = 'getinput' formitem = 'address'
VXI::do_recognition()
PromptManager::Play()
Newly queued prompts are now being played
Wed 30 Sep 2009 11:03:57 AM EDT:
dtmf input: 92807#
Found grammar match
hypothesis #0: 92807 (0.9990)
Cache Miss: http://ivr.where2getit.com/lite?action= ... 7c50%7c100
Attempting to fetch http://ivr.where2getit.com/lite?action= ... 7c50%7c100
VXI::assign_element(name="document.locations" expr = "updateFromResponseXML(geoLocs)")
VXI::foreach_element()
received event: connection.disconnect.hangup:
VXI::exit_element()
Call End Event
Ending session
Ending Session On Channel 17
Thank you.
Jon