cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
730
Views
6
Helpful
3
Replies
mencarnacion
Beginner

Retrieve Terminal Description from CTI event

Hi Everyone,

Is there a way to actually retrieve the terminal description from a Terminal event?

I can get the called / calling address display name by getCalledPartyInfo().
But what I'm interested in is the actual information of the Terminal.

Description: Lab MyTerminal

Is there a way to get that value?

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Mohan,

I've managed to execute SOAP request to AXL.

private static void directQuery() throws IOException {
System.setProperty("javax.net.ssl.trustStore", "C:/glassfish3/glassfish/domains/domain1/config/cacerts.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
InetAddress addr = InetAddress.getByName("192.168.9.12");
String host = addr.getHostName();
System.out.println("TEST += " + host);
URL url = new URL("https://" + host + ":8443/axl/");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
String authorization = "user:pass";
String encoding = Base64.encode(authorization.getBytes("UTF-8"));
conn.setRequestProperty("Authorization", "Basic " + encoding);
String version = "10.0";
conn.setRequestProperty("SOAPAction", "\"CUCM:DB ver=" + version + " getPhone\"");
conn.setRequestProperty("Content-Type", "text/xml");
conn.setRequestProperty("Connection", "Keep-Alive");
// Create an OutputStreamWriter for the URLConnection object and make the request
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
System.out.println("1 - THIS CURRENT TIME " + System.currentTimeMillis());
String AXLRequest = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://www.cisco.com/AXL/API/" + version + "\">";
AXLRequest += "<soapenv:Body><ns:getPhone><name>SEP000C30527EAF</name></ns:getPhone></SOAP-ENV:Envelope>";
writer.write(AXLRequest);
// writer.write(AXLRequest);
writer.flush();
// Read the response
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
// Output the response to the console;
String line;
String response ="";
while ((line = reader.readLine()) != null) {
System.out.println(line);
response += line;
}
System.out.println("2 - THIS CURRENT TIME " + System.currentTimeMillis());
writer.close();
reader.close();
parseSOAPDeviceResponse(response);
}

Thanks

View solution in original post

3 REPLIES 3
mpotluri
Contributor

No Cisco JTAPI doesn't have or expose this information. You probably need to use AXL interface.

Hi Mohan,

Could you show me some sample code as to how to do that?

I'm using CUCM 9.1

Thank you.

Hi Mohan,

I've managed to execute SOAP request to AXL.

private static void directQuery() throws IOException {
System.setProperty("javax.net.ssl.trustStore", "C:/glassfish3/glassfish/domains/domain1/config/cacerts.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
InetAddress addr = InetAddress.getByName("192.168.9.12");
String host = addr.getHostName();
System.out.println("TEST += " + host);
URL url = new URL("https://" + host + ":8443/axl/");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
String authorization = "user:pass";
String encoding = Base64.encode(authorization.getBytes("UTF-8"));
conn.setRequestProperty("Authorization", "Basic " + encoding);
String version = "10.0";
conn.setRequestProperty("SOAPAction", "\"CUCM:DB ver=" + version + " getPhone\"");
conn.setRequestProperty("Content-Type", "text/xml");
conn.setRequestProperty("Connection", "Keep-Alive");
// Create an OutputStreamWriter for the URLConnection object and make the request
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
System.out.println("1 - THIS CURRENT TIME " + System.currentTimeMillis());
String AXLRequest = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://www.cisco.com/AXL/API/" + version + "\">";
AXLRequest += "<soapenv:Body><ns:getPhone><name>SEP000C30527EAF</name></ns:getPhone></SOAP-ENV:Envelope>";
writer.write(AXLRequest);
// writer.write(AXLRequest);
writer.flush();
// Read the response
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
// Output the response to the console;
String line;
String response ="";
while ((line = reader.readLine()) != null) {
System.out.println(line);
response += line;
}
System.out.println("2 - THIS CURRENT TIME " + System.currentTimeMillis());
writer.close();
reader.close();
parseSOAPDeviceResponse(response);
}

Thanks

View solution in original post

Content for Community-Ad

This widget could not be displayed.