This document was generated from CDN thread
Created by: Mayank Sharma on 30-01-2009 02:11:40 PM
I am trying to push simple text on the phone from a C# console application. I provider the phone user credentials, the web server on the phone is enabled but still I get this exception:
The remote server returned an error: (401) Unauthorized.
This is XML:
<CiscoIPPhoneText>
<Title>Title Text Goes Here</Title>
<Prompt>The prompt text goes here</Prompt>"
<Text>The text to be displayed as the message body</Text>
<SoftKeyItem>
<Name>Cancel</Name>
<URL>SoftKey:Cancel</URL>
<Position>4</Position>
</SoftKeyItem>
</CiscoIPPhoneText>
What else can I check to get rid of this exception? Also, is there a way I can bypass authentication and just push text or whatever on the phone, may be by using Admin user credentials?
Thanks,
Max
Subject: Re: CGI/Execute: The remote server returned an error: (401) Unauthorized.
Replied by: David Staudt on 30-01-2009 03:26:31 PM
There is no way to disable the authentication.
If you are POSTing the XML object directly to the phone at /CGI/Execute I wouldn't expect a 401. Perhaps that error is returned if the phone web server is disabled...though you mentioned that is not the case.
Looking at a network packet capture is usually the best way to troubleshoot IPPS, as you can be assured of exactly what is getting sent-to/returned-from the phone: making sure the phone's PC switch port is enabled, use Wireshark on a PC plugged into the phone to capture the network packets.
You can post an attachment of the capture file here if you can't spot anything.
Subject: Re: CGI/Execute: The remote server returned an error: (401) Unauthorized.
Replied by: Mayank Sharma on 30-01-2009 09:09:21 PM
Seems like I got a little further, but still getting 401 Unauthorized exception. I added the Auhorization header to the HttpWebRequest like this
byte[] credentialBuffer = new UTF8Encoding().GetBytes(userName + ":" + password);
req.Headers = "Basic " + Convert.ToBase64String(credentialBuffer);
Now I see the Authorization header in WireShark and it goes a little further than before to try to authenticate my credentials by posting my UserID, Password and DeviceName to ccmip/authenticate.jsp. The host where this request is sent shows up as TFTP server on my phone's Network Configuration.
Now what should I be missing to see this exception?
Would you like to see the capture?
Thanks,
Max
Subject: Re: CGI/Execute: The remote server returned an error: (401) Unauthorized.
Replied by: David Staudt on 30-01-2009 10:04:28 PM
If the phone is checking the authentication URL, then that means it should be extracting the credentials ok. What does the authentication server return?
Even if the auth server returned unauthorized I still wouldn't expect a 401 from the phone to the app.
Let's take a look at the pcap.