This task is to create a VXML document that will consume a response XML document from our servers. The VXML application will provide a store locator response using phone postal code input. You will create a developer account in the PlumVoice system ([login to view URL]) to test this. You won't need anything other than their scratchpad application and our response XML.
The development phone # is from Boston so you must be able to interact with your touch tone phone and this number.
## Deliverables
Here is a start of an application. It doesn't fully work.
<?xml version="1.0"?>
<vxml version="2.0">
<var name="appkey" expr="'3309B8E6-38D2-315F-06C-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="[login to view URL]" />
<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="[login to view URL]" />
<assign name="[login to view URL]" expr="updateFromResponseXML(geoLocs)" />
<goto next="#results" />
</filled>
</field>
</form>
<form id="results">
<block>
<foreach item="location" array="[login to view URL]">
<log expr="'***** LOCATION DETAIL ' + [login to view URL]" />
</foreach>
</block>
</form>
</vxml>
This does not work but gives an example of what needs to be done.
Rather than logging the locations in the final foreach loop, the locations should be played back to the caller via TTS. There should be an option for each location played back to be transferred to the phone number returned for that location.
Finally, an option should exist to allow the caller to perform another search.
Here is an example XML response to be processed by the VXML
<response code="1">
<collection name="poi" count="2" >
<poi>
<name>North Orange FSU</name>
<_distance>3.09</_distance>
<_distanceuom>mile</_distanceuom>
<acceptscfacard>true</acceptscfacard>
<address1>2575 North Tustin Street</address1>
<address2/>
<city>Orange</city>
<clientkey>01892</clientkey>
<conceptcode>CFA</conceptcode>
<country>US</country>
<county>Orange</county>
<fax/>
<hasdiningroom>false</hasdiningroom>
<hasdrivethru>true</hasdrivethru>
<icon>default</icon>
<marketablename>northorange</marketablename>
<marketableurl>[login to view URL]</marketableurl>
<offersonlineordering>true</offersonlineordering>
<offerswireless>false</offerswireless>
<operatorname>Joe Smith</operatorname>
<phone>YYY-YYY-YYYY</phone>
<playground>interior</playground>
<postalcode>92865</postalcode>
<province/>
<servesbreakfast>false</servesbreakfast>
<state>CA</state>
<status>open</status>
<uid>949684484</uid>
<zipextension>3002</zipextension>
</poi>
-
<poi>
<name>The Market Place FSU</name>
<_distance>8.80</_distance>
<_distanceuom>mile</_distanceuom>
<acceptscfacard>true</acceptscfacard>
<address1>13490 Jamboree Road</address1>
<address2/>
<city>Irvine</city>
<clientkey>01536</clientkey>
<conceptcode>CFA</conceptcode>
<country>US</country>
<county>Orange</county>
<fax/>
<hasdiningroom>false</hasdiningroom>
<hasdrivethru>true</hasdrivethru>
<icon>default</icon>
<marketablename>themarketplace</marketablename>
<marketableurl>[login to view URL]</marketableurl>
<offersonlineordering>true</offersonlineordering>
<offerswireless>true</offerswireless>
<operatorname>Bob Smith</operatorname>
<phone>XXX-XXX-XXXX</phone>
<playground>interior</playground>
<postalcode>92602</postalcode>
<province/>
<servesbreakfast>false</servesbreakfast>
<state>CA</state>
<status>open</status>
<uid>949684817</uid>
<zipextension/>
</poi>
</collection>
</response>
Finally, there is sample javascript in the example VXML document listed above to parse the XML.