« Back to IP Phone Services Questions

CGI/Execute: The remote server returned an error: (401) Unauthorized.

Combination View Flat View Tree View
Threads [ Previous | Next ]
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

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.

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

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.