cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
752
Views
0
Helpful
4
Replies

Asp.Net Push to IP Phone

2004yamahaR6
Level 1
Level 1

I was wondering if anyone had an example of how to do a PUSH to the XML Service of an 7960 IP Phone? I'm using Asp.Net with VB.NET (or a c# example).

I'm trying to use the WebRequest and WebResponse objects to complete a CiscoIPPhoneExecute.

With the code I have below, when executes, it just hangs and time's out after about a minute. I don't get any error codes or anything. This code is located in a codebehind page and is executed on a button click:

----------------------------------

Dim url As String = "http://120.1.11.39/CGI/Execute"

Dim messageXml As String = "<CiscoIPPhoneExecute><ExecuteItem Priority=""0"" URL=""Play:badguy.wav""/></CiscoIPPhoneExecute>"

Dim request As WebRequest = WebRequest.Create(url)

request.ContentLength = messageXml.Length

request.Method = "POST"

Dim stm As Stream = request.GetRequestStream()

Dim sw As StreamWriter = New StreamWriter(stm)

sw.Write("XML=")

sw.Write(messageXml)

Dim response As WebResponse = request.GetResponse()

Dim sr As StreamReader = New StreamReader(response.GetResponseStream())

Response.Write(sr.ReadToEnd())

---------------------------------------

Any Suggestions?

4 Replies 4

jmlacoste
Level 1
Level 1

I have had also some troubles using .Net WebRequest. I have finaly purchased IPWORKS v6 components library which is much more eaier to use to build http post requests. It is also must powerfull to handle http errors.

JM Lacoste

So you are using the IPWorks WebForm object to submit your POSTS to the Cisco Phone? Could u not get the .Net WebRequest to work at all and just found the IPWorks components?

I am using nsoftware.IPWorks.Http component.

I succeeded to push infos to IP Phones using .Net WebRequest but when it was not working I could not find how to get the http errors.

In the example of code you provided, the authentification is missing. Did you add it ?

regards, JML

Yah I added it. My computer that I'm developing on isn't on the Domain, but when I do a POST right from a regular form it works, so I'm assuming it should work?

It's just wierd. I'm giong to try testing it with the IPworks components. Cisco is actually here right now setting up the phone system because currently we where just testing it.