06-17-2003 08:33 PM - edited 03-13-2019 12:24 AM
I am wanting to pull information out of a database and send it to a phone, later I will figure out how to accept the username variable from the phone itself but for now I am just trying to figure out how to display information on a phone...
Here is my code, I want to basically create two headings on my phone.
Heading One will display the rsinfo
Heading Two will display the rsinfo2
I have a query in my code, variables are rsinfo and rsinfo2. This ASP page works fine in a browser, it connects to my database and returns all my required info into a HTML table displayed in my web browser.
I am kind of new at this so I hope I made sense. :)
Here is the asp code...
<%
'Variables.
Dim cnnDB, strQuery, strQuery2, rsInfo, rsInfo2
'Connection Instance
Set cnnDB = Server.CreateObject("ADODB.Connection")
cnnDB.Open "DSN=slx"
'SQL query strings.
strQuery = "SELECT * FROM OPPS"
strQuery2 = "SELECT count(Meetings) FROM OPPS WHERE Meetings = 'Day'"
'Execute query and return a recordset.
Set rsInfo = cnnDB.Execute(strQuery)
Set rsInfo2 = cnnDB.Execute(strQuery2)
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<CENTER><H2>
Cisco Test</H2>
<BR>
<TABLE>
<TR>
<TH align="left">
Opps Day
</TH>
<td width="15"><br></td>
<TH align="left">
Opps Night
</TH>
<td width="15"><br></td>
<TH align="left">
Opps Old
</TH>
<td width="15"><br></td>
<TH align="left">
Opps Count
</TH>
</TR>
<%
Do While Not rsInfo.EOF
%>
<TR>
<TD><% =rsInfo("Meetings") %></TD>
<td width="15"><br></td>
<TD><% =rsInfo("MeetingsNight") %></TD>
<td width="15"><br></td>
<TD><% =rsInfo("MeetingsTotal") %></TD>
<td width="15"><br></td>
<TD><% =rsInfo2("") %></TD>
<td width="15"><br></td>
</TR>
<%
'Move to the next record in the
'recordset
rsInfo.MoveNext
Loop
'Close the recordset.
rsInfo.Close
rsInfo2.Close
'Close the database connection.
cnnDB.Close
%>
</TABLE>
</CENTER>
</BODY>
</HTML>
06-23-2003 10:39 AM
Have you made any progress on this since the 17th?
You'll want the IP Phone Services SDK if you don't have it yet already.
http://www.cisco.com/warp/public/570/
You'll need to be a part of the Developer Support Program to get access to it and other materials.
Another good source for creating Cisco IP Phone services is "Developing Cisco IP Phone Services: A Cisco AVVID Solution" by Cisco Press. You can find and preview this book on O'Reilly's Network Safari (http://safari.oreilly.com/). Safari offers a free 14-day trial, so you can get the full content of the book at no cost and get started right away! You'll find everything you need to develop Cisco IP Phone services in this book.
So there are some of the resources that you're going to want to follow up on if you haven't already. In answer to your question, to make your content Cisco-phone friendly, you need to set the output format to text/xml (ie Response.ContentType = "text/xml";) and instead of using HTML tags, use the Cisco XML tags (which are defined in the SDK or the book), such as the CiscoIPPhoneText tag:
06-25-2003 07:10 PM
Thanks a bunch for the reply!
I took your advice and made some nifty little asp test file and it works, I can display information on the phone. Once I add my DB code everything still works, once I try and display my DB Query results I get an error on my phone that says:
XML Error [4]: Parse Error
Here is my code, this works perfect in a web browser as the query runs fine.
<%
response.ContentType = "text/xml"
set conn=Server.CreateObject("ADODB.Connection")
conn.open "DSN=slx"
sql="select count(userid) from sysdba.history where opportunityid ='OWST9a0001UU'"
set rs=Conn.Execute(sql)
response.ContentType = "text/xml"
while (not rs.EOF)
Response.ContentType = "text/xml"
Response.write("
Response.write("
Response.write("
response.write("
Response.write("
Response.write("")
rs.MoveNext
wend
conn.close()
%>
Don't know why it wont work with my phone,
I will buy that book but I did get a good look at it before, if I remember there was little to no information about how to use the cisco phone to pull information out of a database. There has to be something I am doing wrong here. Maybe what I am trying to do is not possible?
06-26-2003 02:23 AM
Hi,
In the CiscoIPPhoneText data type is
That is why there is a parse error, the phone can't parse this field.
btw, you can only send this once, it looks like you are looping through your results....(i am not a VB-guru...)
regards,
Sascha
06-26-2003 06:59 AM
Ah, the error you are getting is probably due to your using the
response.write("
Don't use the
Yes, that book won't talk about getting info from a database, as that is an ASP/Javascript/VBScript issue, and so a book covering web design with ASP would be more suited to your needs.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide