Search code examples
eventsoffice365ms-officeskypeskype-for-business

How to listen to Skype for Business call events


I need to notify a backend server about Skype for Business call events. Calling the backend is not the problem, but listening to call events is. I thought about watching and parsing skype log files, but there seems to be no call information in the log files... And it would be an ugly solution anyway.

Is it possible to somehow listen to SfB call events and trigger custom actions? I know there are various SfB SDKs, but none of them seem to offer a way to listen to these events...

I would like to be able to do something like this (pseudo code, I don't really care what language is used, but would prefer JavaScript):

skype.onCallIncoming(callInfo => {
    console.log(callInfo.user + ' is calling');
    // my custom action
});

skype.onCallAccepted(callInfo => {
    console.log('The call was accepted');
    // my custom action
});

skype.onCallEnded(callInfo => {
    console.log('The call was ended');
    // my custom action
});

Solution

  • SfB does not provide any live "call events" that you can use in ANY SDK.

    For live "calls", the best you can do (with little effort) is to subscribe to a users presence and hook off the "on a call" (on-the-phone) activity token busy status (this presence state is not guaranteed to be correct). The problem with this is you can't really get "all" call events for everyone, since you can only subscribe to endpoints that you know about. There are also problems with working with large scale subscriptions. This can be done with most of the SDK's for Skype include UCWA.

    Another option is to use the CDR database, although that is not for "live" calls and the CDR database needs to be enabled for the site. Once enabled you can just use SQL queries again the DB for historical call data.

    If you really need large scale call monitoring, then the only option is to create a SIP proxy application that runs on the FE machines and translates "sip" messages into call events. This is a lot of work, it seems simple to do but gets very difficult very fast. This will give you "live" call events but will take someone a long long time to get it right and you have to have a deep understanding of SIP.

    If you are talking about just your local Skype desktop client calls ONLY (windows client only), you can use the client SDK to hook into the local client and you can track the call events that way.