Authentication on IP Phone : How to use ?!

Version 1
    This document was generated from CDN thread

    Created by: Pascal EISELE on 23-09-2011 11:29:55 AM
    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();
                }
        }
     
     

    Subject: RE: Authentication on IP Phone : How to use ?!
    Replied by: Gordon Ross on 06-10-2011 11:53:20 AM
    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

    Subject: RE: Authentication on IP Phone : How to use ?!
    Replied by: Sergei Gorbunov on 10-01-2012 12:39:15 AM
    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.

    Subject: RE: Authentication on IP Phone : How to use ?!
    Replied by: Sergei Gorbunov on 10-01-2012 12:42:42 AM
    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");
            }
        }
    }