[英]How to retrieve incoming call number from SAP CDT in Python?
I work in a help desk and we use SAP Communication Desktop as our phone software, though don't know how common this is within the industry.我在帮助台工作,我们使用 SAP Communication Desktop 作为我们的电话软件,但不知道这在行业内有多普遍。
I've been developing a Python program for automating repeating parts of my work (writing tickets, searching number from ServiceNow etc.) Everything works fine, when i input the data manually, but i would love to automate the process and just have Python fetch the information from SAP when call arrives.我一直在开发一个 Python 程序,用于自动重复我的工作部分(写票,从 ServiceNow 搜索号码等)一切正常,当我手动输入数据时,但我想自动化这个过程,只需要 Python fetch呼叫到达时来自 SAP 的信息。 The call number also is displayed near the task bar and I've tried searching Windows Event Viewer for it, but so far have been unable to find it.
电话号码也显示在任务栏附近,我已经尝试在 Windows 事件查看器中搜索它,但到目前为止还没有找到它。
Is this possible to do in Python?这可以在 Python 中做到吗?
Ilmari伊尔马里
You could make use of SAP's Online Interaction Interface (OII) .您可以使用 SAP 的在线交互界面 (OII) 。
It is an API which allows client applications (such as CDT) to interact with the BCM (make calls etc).它是一个 API,允许客户端应用程序(例如 CDT)与 BCM 交互(进行调用等)。
Get your client to connect to the OII and send a IciContainerInterface subscription request by giving it your line-number.让您的客户端连接到 OII 并通过给它您的行号来发送 IciContainerInterface 订阅请求。
The OII will then send events containing information (such as call number) for every phone call pertaining to your line-number to your app.然后,OII 会将包含与您的线路号码相关的每个电话的信息(例如电话号码)的事件发送到您的应用程序。
Download the WSDL from your OII:从您的 OII 下载 WSDL:
http:// ip-address /OII/IciItemService.asmx?WSDL
http:// ip-address /OII/IciItemService.asmx?WSDL
Use WSDL to generate the OII classes使用 WSDL 生成 OII 类
Obtain instance of OII connection:获取OII连接实例:
private Optional<IciContainerServiceSoap> getContainerPort() {
return containerSubscriber.map(s -> {
IciContainerServiceSoap port = s.getIciContainerServiceSoap12();
BindingProvider binding = (BindingProvider) port;
binding.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
createServerUrl(s.getServiceName().getLocalPart(), serverAddress, serverPort));
return port;
});
}
public static String createServerUrl(@NotNull String localPart, @NotNull String serverAddress, int port) {
StringBuilder sb = new StringBuilder();
sb.append("http://");
sb.append(serverAddress);
if (port == 0) port = 80;
if (port != 80) {
sb.append(":");
sb.append(String.valueOf(port));
}
sb.append("/oii/");
sb.append(localPart);
sb.append(".asmx");
return sb.toString();
}
/*
* Address and port on which your client app's webservice will be
* listening for events sent by OII.
*/
public static String createAppURL() throws UnknownHostException {
//
Example: http://xxx.xxx.xxx.xxx:7007/sapws/services/cct?wsdl
return "http://" + getHostName() + ":" + getListenPort() + "/sapws/services?wsdl";
}
Send subscription request:发送订阅请求:
getContainerPort().map(p -> p.subscribe(appURL, getAppId(), "1", container)).orElseThrow(IllegalStateException::new);
Your app will now receive PhoneCallChanged events in the form of SOAP packets on the port specified in the appID (7007).您的应用现在将在 appID (7007) 中指定的端口上以 SOAP 数据包的形式接收PhoneCallChanged事件。
Note that I am using Java.请注意,我使用的是 Java。 I'll elaborate if needed.
如果需要,我会详细说明。 Goodluck!
好运!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.