Page 1 of 1

Problems picking up namelist variable in ASP

Posted: Tue Mar 16, 2004 9:49 am
by sao13
I have a .vxml file that submits to an ASP page. Within that ASP page, I'm trying to grab the variable passed in the namelist. When I just pass a name:value pair in my address bar, my asp page picks it up and displays the appropriate vxml response.

Here's my .vxml file.
<?xml version="1.0"?>
<vxml version="2.0">

<form id="counselor">
<field name="id">
<grammar
type="application/x-regexp">[0-9]{10}</grammar>
<prompt>
Enter the ten digit VAP Office number.
</prompt>
<filled>
You entered <value expr="id"/>.
<submit next="counselorwrite.asp"
namelist="id"/>

</filled>
</field>
</form>
</vxml>

And here's my asp page that can't seem to pick up the namelist.

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

<%@ Language=VBScript %>
<%
Dim intVAPOfficeNo
intVAPOfficeNo=Request("id")
Response.Write intVAPOfficeNo
Response.ContentType = "text/xml"
%>
<form id="counselor">
<block>
<audio>
Counselor is <%= intVAPOfficeNo %>
</audio>
<exit/>
</block>
</form>
</vxml>

Thanks

Updated asp page

Posted: Tue Mar 16, 2004 2:12 pm
by sao13
I have made some necessary changes to the asp page, but it still doesn't work.
Instead of
intVAPOfficeNo=Request("id"),
I have
intVAPOfficeNo=Request.Form("id").

I also took out the <audio> tags so it now actuallys speaks "Counselor is" before it hangs up.

IVR code from counselorwrite.asp slightly modified

Posted: Tue Mar 16, 2004 2:39 pm
by support
Hello,

It appears as though you have some very minor errors in your ASP page. Here is your IVR code from counselorwrite.asp slightly modified.

Code: Select all

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

<%@ Language=VBScript %>
<%
Dim intVAPOfficeNo
intVAPOfficeNo=Request("id")
Response.ContentType = "text/xml"
%>

    <form id="counselor">
        <block>
            Counselor is <%= intVAPOfficeNo %>
            <exit/>
        </block>
    </form>
</vxml>
The main difference between this IVR code and your original IVR code is that you do not want to do a response.write before the <form>. Doing so will result in invalid VXML. You instead only want to print the value of intVAPOfficeNo within the block. Hope This Helps! :)

Thanks

Posted: Tue Mar 16, 2004 4:19 pm
by sao13
Thank you so much. I knew I was close.