cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1318
Views
0
Helpful
3
Replies

<CiscoIPPhoneExecute> error

dglanton1
Level 1
Level 1

Im wanting to send a <CiscoIPPhoneExecute> xml command to a 7921G phone. When i send the command, the phone shows "Host Not Found" and the response from my stream say "The remote server returned an error: (500) Internal Server Error." I want to write this in c# but could do it in Java also. This used to work for me a while back but it is not anymore. Any help would be appreciated!

My Code:

WebResponse resp = null;

string ErrorCode = "";

string ResponseXML = "";

string pushXML = "<CiscoIPPhoneExecute>";

pushXML += "<ExecuteItem Priority=\"0\" URL=\"Play:Vibe.raw\"/>";

pushXML += "</CiscoIPPhoneExecute>";

pushXML = "XML=" + HttpUtility.UrlEncode(pushXML);

string PhoneURL = string.Format("http://{0}/CGI/Execute", "MyIPAddress");

HttpWebRequest req = (HttpWebRequest)WebRequest.Create(PhoneURL);

req.Method = "POST";

req.AllowAutoRedirect = false;

req.ContentType = "application/x-www-form-urlencoded";

req.Credentials = GetCredentials("MyUsername", "MyPassword");

byte[] bytes = null;

bytes = System.Text.Encoding.UTF8.GetBytes(pushXML);

Stream outputStream = req.GetRequestStream();

outputStream.Write(bytes, 0, bytes.Length);

outputStream.Close();

resp = req.GetResponse();

Stream s = resp.GetResponseStream();

StreamReader stm = new StreamReader(s);

if (stm == null)

{

     "Timed out or no response!";

}

else

{

          ResponseXML = stm.ReadToEnd();

          stm.Close();

}

s.Close();

resp.Close();

3 Replies 3

amoherek
Cisco Employee
Cisco Employee

Hi Dexter,

Is web access enabled on the 7921 phone? If so, can you "Apply Config"?

What happens when you enter the IP address of the phone in your web browser?

Thanks,

Adrienne


Web access is enabled. Im not real sure what you mean by "Apply Config"? I can put in "http://<MyPhoneIP>/CGI/Execute" or just the IP address alone and i get a page with all of the phones info and network information.

Hi Dexter,

I see you created the same post in IP Phone Services which is the correct location for this post. I'll respond in that post instead of this one.

&lt;CiscoIPPhoneExecute&gt; Problem

Thanks,

Adrienne