简体   繁体   English

如何在 Python 中从 SAP CDT 检索来电号码?

[英]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 会将包含与您的线路号码相关的每个电话的信息(例如电话号码)的事件发送到您的应用程序。

Instructions说明

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.

相关问题 从自动驾驶仪中的传入短信中检索电话号码的任何方式 - Any way to retrieve phone number from incoming sms in autopilot 如何使用 Python 从出站 Twilio 调用中检索信息? - How to retrieve information from outbound Twilio call with Python? 如何从以字符串表示的数字中检索Python格式的代码? - How to retrieve Python format code from number represented as string? 如何在 python 中查询从 Firestore 返回的记录数? - How to retrieve number of records returned from firestore where query in python? twilio 来电事件侦听器未调用但在我拨打我的 twilio 号码时响铃 python flask - twilio incoming call event listener not called but ringing when i call my twilio number python flask 从日期时间 excel 在 python 中检索周数 - retrieve week number from datetime excel in python 从 python 3 中的 fetchone() 调用中检索值 - Retrieve value from a fetchone() call in python 3 从 Python 中的文本文件中检索数字 - Retrieve a number from a text file in Python 记录来电号码并终止呼叫服务器端 - Recording incoming phone number and terminating the call serverside Python:如何根据传入文件的数量更改线程数? - Python: How can I alter the number of threads based on the number of incoming files?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM