07-16-2015 12:24 PM
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.
Solved! Go to Solution.
07-19-2015 09:42 AM
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
07-17-2015 10:05 AM
No Cisco JTAPI doesn't have or expose this information. You probably need to use AXL interface.
07-17-2015 10:45 AM
Hi Mohan,
Could you show me some sample code as to how to do that?
I'm using CUCM 9.1
Thank you.
07-19-2015 09:42 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide