We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Problems picking up namelist variable in ASP

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
sao13
Posts: 7
Joined: Tue Feb 10, 2004 4:03 pm

Problems picking up namelist variable in ASP

Post 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

sao13
Posts: 7
Joined: Tue Feb 10, 2004 4:03 pm

Updated asp page

Post 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.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR code from counselorwrite.asp slightly modified

Post 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! :)
Last edited by support on Thu Feb 25, 2010 5:20 pm, edited 3 times in total.

sao13
Posts: 7
Joined: Tue Feb 10, 2004 4:03 pm

Thanks

Post by sao13 »

Thank you so much. I knew I was close.

Post Reply