« Back to IP Phone Services Questions

RE: Authentication on IP Phone : How to use ?!

Combination View Flat View Tree View
Threads [ Previous | Next ]
I'm trying to use CiscoIPPhoneText to send a kind of "SMS" to an IP Phone but I don't understand which username and password I should send to the phone ?
 
What should I configure to make it works ?
 
Here is my test program (JAVA) always response :
HTTP/1.1 401 Unauthorized
 
Here is the code :
public static void sendMessageHTTP(String message, String dest)
    {
        try {
            List<NameValuePair> qParams = new ArrayList<NameValuePair>();

            String data = "";
            data += "<CiscoIPPhoneText>\n";
            data += "<Title>Title text goes here</Title>\n";
            data += "<Prompt>The prompt text goes here</Prompt>\n";
            data += "<Text>The text to be displayed as the message body goes here</Text>\n";
            data += "</CiscoIPPhoneText>";

            qParams.add(new BasicNameValuePair("XML", data));

            DefaultHttpClient httpClient = new DefaultHttpClient();
           
            // L'utilisateur et mot de passe doivent être encodés en base64
            httpClient.getCredentialsProvider().setCredentials(
                    new AuthScope(HOST, 80),
                    new UsernamePasswordCredentials(
                            org.apache.commons.codec.binary.Base64.encodeBase64String(USER.getBytes()),
                            org.apache.commons.codec.binary.Base64.encodeBase64String(PASSWORD.getBytes())));
           
            String uri = "http://" + dest + "/CGI/Execute";
       
            System.out.println(uri);
       
            HttpPost post = new HttpPost(uri);
                post.setEntity(new UrlEncodedFormEntity(qParams, HTTP.UTF_8));
           
            HttpResponse response;
       
                response = httpClient.execute(post);
                System.out.println(response.getStatusLine());
   
            } catch (ClientProtocolException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
    }
 
 

I'm trying to use CiscoIPPhoneText to send a kind of "SMS" to an IP Phone but I don't understand which username and password I should send to the phone ?

 

My understanding is that it has to be a CUCM application user associated with the device.
 
GTG

Phone device have an individual or enterprise level setting "Authetication URL". When phone receive an HTTP request, it sends a request to this URL with credentials specified in original request. If an application behind "Authetication URL" response with "AUTHORIZED" then phone process the original request. See "HTTP Server Requests" section in IPPS Application Development Notes.

There is a simple ASPX app page (URL to this app must be placed in "Authetication URL" phone setting) that authorizes any request:


namespace AuthorizedResponder
{
public partial class _Default : System.Web.UI.Page
{
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);

Response.Clear();
Response.Write("AUTHORIZED");
}
}
}