Page 1 of 1

Passing voicexml variable to asp

Posted: Thu Oct 30, 2008 9:27 am
by soso
Hi,

I've this code:

Code: Select all

      
    <form id="input">
        
        <field name="number" type="digits?maxlength=11">
            <audio src="media/number.wav" />

            <grammar src="grammars/service.grxml#number" type="application/srgs+xml"/>
        </field>

        <filled namelist="number">
        
            <% 
                
                Dim number As String As String = %> <value expr="number1" /> <% 
                
                If IsValidNumber(number) Then

...
I would like to pass variable on the filled section to asp .net. How do I proceed?

Http Request doesn't work because I don't send the page?

And this line:

Dim number As String As String = %> <value expr="number1" /> <%

It's wrong code.

Can you help me?

Thanks[/code]

IVR code to pass VXML variable to ASP

Posted: Thu Oct 30, 2008 11:13 am
by support
Hi,

To pass your VoiceXML variable to ASP, you would have to <submit> your variable to an ASP page. Here's some example IVR code that should help you do this:

collectinfo.vxml:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">

<form>
  <field name="customerid" type="digits">
      <prompt>
        Please enter your customer identification number using your keypad.
      </prompt>
  </field>

  <field name="age" type="digits?minlength=1;maxlength=2">
      <prompt>
        Please enter your age using your keypad.
      </prompt>
  </field>

  <block>
    <prompt> Please wait while we process your information. </prompt>
    <submit namelist="customerid age" next="http://mightyserver.com/submit.aspx"/>
  </block>
</form>

</vxml>
submit.aspx:

Code: Select all

<%Response.ContentType = "text/xml"%>
<?xml version="1.0"?>

<%
dim customerid
dim age
customerid = Request.QueryString("customerid")
age = Request.QueryString("age")
%>

<vxml version="2.0">
   <form>
      <block>
         <prompt> Your customer identification number is <%Response.Write(customerid)%>. </prompt>
          <prompt> Your age is <%Response.Write(age)%>. </prompt>
      </block>
   </form>
</vxml> 
Regards,
Plum Support