Note: A new version of the Skype for Business Intranet Chat Bot developed on Dotnet Core using Bot Framework SDK V4 is available here
Skype for Business is the one of the most common enterprise Instant Messaging platform for thousands of businesses worldwide. However, as a messaging platform, Skype for Business 2015 On-Premise does not support bots out of the box. As per Microsoft, the Skype for Business Bot Framework channel is currently supported for Skype for Business Online and Skype for Business Hybrid environments only. Refer this.
Skype for Business On-Premise has a set of APIs called Unified Communications Web API (UCWA) which can be leveraged to integrate with the Bot framework. UCWA 2.0 is a REST API that exposes Skype for Business Server 2015 instant messaging (IM) and presence capabilities. For a bot to send and receive message using UCWA, the following steps are required to be performed.
- Auto Discovery – finding the Lync Server.
- Authenticate the Bot with the Lync Server.
- Register the App on the Lync Server.
Once the App is registered on Lync server, one can send and receive messages to the bot using Skype. The detailed steps to register an application on the Lync server can be found here. https://ucwa.skype.com/documentation/keytasks-createapplication
At this point, the high level architecture of the application will look like this.
The application will now poll the Lync server for incoming messages. When a message is received by the application, we bootstrap our bot and pass the text as properly formatted Activity message. The bot then follows usual flow of sending the text to LUIS and determining the intent. Based on the context, it will then send the response back to the user. The end to end architecture of the bot can be seen below.
The source code can be found here. It is based on Ankit Sinha’s sample, very well explained blog, written for Skype for Business Online.
The Skype for Business On-Premise bot has advantages which the Enterprise demands like
- Keeping the data and the application On-Premise
- Using the common communication channel IM
- Leveraging Cloud services like LUIS cognitive service and App Insights
- Work behind corporate proxy.