Log In
Developer Network
Technologies
Join the Network
Member Services
Events & Community
IP Phone Services (IPPS) Developer Center
Overview
Documentation
Community
Wiki
Testing
Message Boards Home
Recent Posts
Statistics
Answer
(
Unmark
)
Mark as an Answer
« Back to IP Phone Services Questions
RE: Authentication on IP Phone : How to use ?!
Threads [
Previous
|
Next
]
Pascal EISELE
Posts:
1
Join Date:
4/5/11
Recent Posts
Authentication on IP Phone : How to use ?!
java
Answer
9/23/11 4:29 PM
Mark as an Answer
Submit
Reply with Quote
Quick Reply
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();
}
}
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top
Gordon Ross
Posts:
11
Join Date:
9/26/08
Recent Posts
RE: Authentication on IP Phone : How to use ?!
Answer
10/6/11 4:53 PM as a reply to Pascal EISELE.
Mark as an Answer
Submit
Reply with Quote
Quick Reply
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
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top
Sergei Gorbunov
Posts:
22
Join Date:
7/19/10
Recent Posts
RE: Authentication on IP Phone : How to use ?!
Answer
1/10/12 6:39 AM as a reply to Gordon Ross.
Mark as an Answer
Submit
Reply with Quote
Quick Reply
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.
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top
Sergei Gorbunov
Posts:
22
Join Date:
7/19/10
Recent Posts
RE: Authentication on IP Phone : How to use ?!
Answer
1/10/12 6:42 AM as a reply to Sergei Gorbunov.
Mark as an Answer
Submit
Reply with Quote
Quick Reply
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");
}
}
}
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top