Code not working with Plum and ASP.Net
Posted: Fri Jul 02, 2010 2:08 am
hi
The following is the code written by me is there any wrong in the code.
<form id="clockin">
<field name="customerid" type="digits?length=5">
<grammar root="ROOT" type="application/srgs+xml" mode="dtmf">
<rule id="ROOT" scope="public">
<one-of>
<item repeat="0-255">
<ruleref uri="#digit"/>
</item>
<item> "#" </item>
</one-of>
</rule>
<rule id="digit" scope="public">
<one-of>
<item> 0 </item>
<item> 1 </item>
<item> 2 </item>
<item> 3 </item>
<item> 4 </item>
<item> 5 </item>
<item> 6 </item>
<item> 7 </item>
<item> 8 </item>
<item> 9 </item>
<item> "#" </item>
</one-of>
</rule>
</grammar>
<prompt>
You have selected for Clock In.
</prompt>
<prompt>
Enter Client ID and press Hash to Submit.
</prompt>
<filled>
<if cond="customerid.indexOf('#') != -1">
<assign name="customerid" expr="customerid.toString().replace(/#/,'')"/>
<prompt>
You entered <value expr="customerid"/>. Please wait while we process your information.
</prompt>
<else/>
<prompt>
You entered <value expr="customerid"/>. You must press hash to submit your client ID.
</prompt>
<!--<clear namelist="sendid customerid clockin"/>-->
</if>
</filled>
<noinput>
Sorry, No Input received.
<reprompt/>
</noinput>
<nomatch>
Sorry, Invalid Client ID.
<reprompt/>
</nomatch>
</field>
<subdialog name="sendid" namelist="customerid" src="http://kishore.somee.com/test.aspx">
<filled>
<if cond="sendid.confirmation=='verified'">
<prompt>
Your customer ID was verified.
</prompt>
<goto next="#caretaker"/>
<else/>
<prompt>
Your customer ID was not verified.
</prompt>
<!--<clear namelist="sendid customerid clockin"/>-->
</if>
</filled>
</subdialog>
</form>
ASP.NET code
<%@ Page Language="C#" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Configuration" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Linq" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Web.Security" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.HtmlControls" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="System.Web.UI.WebControls.WebParts" %>
<%@ Import Namespace="System.Xml.Linq" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<% Response.ContentType = "text/xml"; %>
<?xml version="1.0"?>
<%
String customerid = Request.QueryString["customerid"].ToString();
String confirmation = "verified";
SqlConnection oCon = new SqlConnection(ConfigurationManager.ConnectionStrings["CONNECTION_STRING"].ConnectionString.ToString());
SqlCommand oCmd = new SqlCommand("select count(*) from client where client_id=" + Request.QueryString["customerid"].ToString(), oCon);
oCmd.CommandType = CommandType.Text;
oCon.Open();
int intStatus = Convert.ToInt32(oCmd.ExecuteScalar());
oCon.Close();
%>
<vxml version="2.0">
<form>
<block>
<var name="confirmation" expr="<% Response.Write(confirmation); %>"/>
<% if(intStatus > 0 ) { %>
<prompt> Your Customer ID is <% Response.Write(customerid); %>. </prompt>
<% } else { %>
<prompt> You Entered Customer ID is Invalid. </prompt>
<% } %>
<return namelist="confirmation"/>
</block>
</form>
</vxml>
System troughs the error saying that HTTP error 500
The following is the code written by me is there any wrong in the code.
<form id="clockin">
<field name="customerid" type="digits?length=5">
<grammar root="ROOT" type="application/srgs+xml" mode="dtmf">
<rule id="ROOT" scope="public">
<one-of>
<item repeat="0-255">
<ruleref uri="#digit"/>
</item>
<item> "#" </item>
</one-of>
</rule>
<rule id="digit" scope="public">
<one-of>
<item> 0 </item>
<item> 1 </item>
<item> 2 </item>
<item> 3 </item>
<item> 4 </item>
<item> 5 </item>
<item> 6 </item>
<item> 7 </item>
<item> 8 </item>
<item> 9 </item>
<item> "#" </item>
</one-of>
</rule>
</grammar>
<prompt>
You have selected for Clock In.
</prompt>
<prompt>
Enter Client ID and press Hash to Submit.
</prompt>
<filled>
<if cond="customerid.indexOf('#') != -1">
<assign name="customerid" expr="customerid.toString().replace(/#/,'')"/>
<prompt>
You entered <value expr="customerid"/>. Please wait while we process your information.
</prompt>
<else/>
<prompt>
You entered <value expr="customerid"/>. You must press hash to submit your client ID.
</prompt>
<!--<clear namelist="sendid customerid clockin"/>-->
</if>
</filled>
<noinput>
Sorry, No Input received.
<reprompt/>
</noinput>
<nomatch>
Sorry, Invalid Client ID.
<reprompt/>
</nomatch>
</field>
<subdialog name="sendid" namelist="customerid" src="http://kishore.somee.com/test.aspx">
<filled>
<if cond="sendid.confirmation=='verified'">
<prompt>
Your customer ID was verified.
</prompt>
<goto next="#caretaker"/>
<else/>
<prompt>
Your customer ID was not verified.
</prompt>
<!--<clear namelist="sendid customerid clockin"/>-->
</if>
</filled>
</subdialog>
</form>
ASP.NET code
<%@ Page Language="C#" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Configuration" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Linq" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Web.Security" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.HtmlControls" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="System.Web.UI.WebControls.WebParts" %>
<%@ Import Namespace="System.Xml.Linq" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<% Response.ContentType = "text/xml"; %>
<?xml version="1.0"?>
<%
String customerid = Request.QueryString["customerid"].ToString();
String confirmation = "verified";
SqlConnection oCon = new SqlConnection(ConfigurationManager.ConnectionStrings["CONNECTION_STRING"].ConnectionString.ToString());
SqlCommand oCmd = new SqlCommand("select count(*) from client where client_id=" + Request.QueryString["customerid"].ToString(), oCon);
oCmd.CommandType = CommandType.Text;
oCon.Open();
int intStatus = Convert.ToInt32(oCmd.ExecuteScalar());
oCon.Close();
%>
<vxml version="2.0">
<form>
<block>
<var name="confirmation" expr="<% Response.Write(confirmation); %>"/>
<% if(intStatus > 0 ) { %>
<prompt> Your Customer ID is <% Response.Write(customerid); %>. </prompt>
<% } else { %>
<prompt> You Entered Customer ID is Invalid. </prompt>
<% } %>
<return namelist="confirmation"/>
</block>
</form>
</vxml>
System troughs the error saying that HTTP error 500