You could make use of SAP's Online Interaction Interface (OII).
It is an API which allows client applications (such as CDT) to interact with the BCM (make calls etc).
Get your client to connect to the OII and send a IciContainerInterface subscription request by giving it your line-number.
The OII will then send events containing information (such as call number) for every phone call pertaining to your line-number to your app.
Instructions
Download the WSDL from your OII:
http://ip-address/OII/IciItemService.asmx?WSDL
Use WSDL to generate the OII classes
Obtain instance of OII connection:
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).
Note that I am using Java. I'll elaborate if needed. Goodluck!