キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 
cancel
1378
閲覧回数
6
いいね!
3
返信

Retrieve Terminal Description from CTI event

mencarnacion
Level 1
Level 1

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 件の受理された解決策

受理された解決策

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

元の投稿で解決策を見る

3件の返信3

mpotluri
Level 5
Level 5

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