Search code examples
phpasp.netasp.net-web-apivxml

Asp + vXML dynamic data


I have been put in charge of building an IVR using vXML and asp.net. For some reason the voice server we are using requires ASP.net and cannot use PHP in conjunction with vXML so I am stuck learning ASP.net. The application is pretty simple in that it runs an ASP.net file with vXML and should pull data from a database based on user input.

Example: User enters customer ID "23313" It should then pull data from our SQL2012 DB that corresponds to that ID and read it back via prompts. Simple enough I figured.

A have a couple questions regarding possible solutions to this -

Is it possible for ASP/vXML to pull data from PHP dynamically (post or get statements), and use the data in the current vXML document? or will I have to bite the bullet and figure out a second page?

if using PHP is not ideal or possible, would it be better or possible to add a db connection into the asp/vXML document and run the IVR that way?

I am not very familiar with ASP.net, and am trying to find out the most efficient way to accomplish my goal without having to have an additional vXML page to run.

Any help appreciated.

EDIT After further investigation and help from Jim I was able to get inline PHP working. The server I was using was set to go specifically to this asp.net and did not have PHP installed on the server itself. After installing PHP, changing where the server was looking for the file, I am able to run the latest PHP version in my app.

Deleted code sample as it was completely irrelevant


Solution

  • The ASP requirement seems odd, unless you are leveraging some type of library within the ASP.net environment. VoiceXML browsers, are just that, a browser. It should be able to process VXML from the standard sources. I suspect you are working within a framework that requires the serverside ASP.

    If your browser is VoiceXML 2.1 compliant, you should have access to the Data element. This element allows you to make Get and Post requests to a server, get back XML and parse the data within Javascript. Note, the return data must be valid XML.

    Any database connection would have to be on the ASP.net side of the solution. VoiceXML gets data by transitioning to a new page (goto or subdialog element) or the Data element above.