What is this article about?
In this article, we would like to talk about what Microsoft offers in its Lync SDK for producing ‘pretty’ interfaces and new Lync-client possibilities.
We will talk in detail about UI Suppression Mode interaction with Lync client, which we had to deal with while developing our own corporate messenger based on Skype for Business. Most im-portantly, I will do my best to describe the constraints we had to face at length.
How it all began
In spring 2014 we came up with the idea of a corporate messenger based on Lync (now Skype for Business). I should mention that in the beginning it wasn’t about making a messenger, we would just modify Lync for ourselves to work more effectively. We basically used Lync client in ‘normal mode’ and added our app which could manage contacts. It helped you locate your favorite contacts on the screen and put them in order, and it provided quick access, which was convenient for working on desktops. The app was called EasyLy (derived from Easy Lync) and was distributed among our friends. More information on the story of its creation can be found here.
Image 1. This is what one of the first versions of EasyLy looked like.
Eventually the app would acquire new functions. For instance, you could chat in both Lync and EasyLy, whereas only the latter would retain history. It was a landmark decision when we gave up on UI Lync and implement its features on our own so that the track of Lync was only in task manager. In other words, we came up with an idea of our own more convenient messenger for desktops based on Lync. Everything seemed fine in the beginning.
What did we want to achieve?
In the beginning one of the Lync’s inconveniences was the lack of more or less satisfying mechanism of storing and viewing conversation history. Lync does retain (after a certain time) its history in Outlook, but it is extremely inconvenient. Besides, there is a chance that the history won’t be saved at all if, for instance, you close the window of a conversation before the history is saved.
As regards to usability, we advocated the concept of ‘one click’ to save users time and improve their efficiency. We tried to create an app which would be super easy and user-friendly for an office worker. The target audience that we defined for ourselves consisted not of the trendy smartphone-oriented employees, but also of regular office workers who spend 8 hours a day in front of a big screen so everything has to be ergonomic.
Apart from the previous tab ‘Favorites’, we got the ideas for such tabs as ‘Groups’ and ‘Dia-logs’, as well as call history with comments, a conference call window, the possibility to send messages to someone offline, calendar integration, OneDrive, and many more interesting functions. We planned to create additional value for the user through the UI for desktops, quick access to the existing fea-tures, and the continued development of new enterprise functions.
Image 2 EasyLy’s current interface
The first thing was the ‘Favorites’ tab, where the user could arrange all his/her contacts and sort them into groups. We got down to work and implemented the idea without any difficulties using the Lync SDK 2013. All contacts were made as cards, which allowed to see the list of meetings of a cer-tain user, call (audio, video calls), or send a message. You’d bring up a standard Lync conversation win-dow by clicking these buttons.
Image 3. Contact icon when placing the cursor
This was quite easy. Excited by our success we kept on pressing forward and completely gave up on Lync UI (transferred Lync client to UI Suppression Mode). This gave us the opportunity do away with standard conversation and call windows (pretty much all windows) and implement all the basic features of the app on our own.
I won’t get into details about user authorization; you can read the description here, I’d rather talk about our second tab ‘Dialogs’, which we had been implementing for almost a year.
Image 4. Dialogs tab with multichat mode on
As you might suppose, we started with text conversations. Everything went well, but it was slow going because in addition to standard sending and receiving messages, we needed to implement typing, emoticons, rtf formatting support, etc. You can find Lync IM Conversation implementation here.
Message storage and call history were embedded on SQLite platform, which offers versatile use. We also allowed for several open chats to be supported simultaneously (up to 3) for high-speed communication between employees.
After that, we added audio/video call support and screen/app sharing. It took us quite a long time to add Application Sharing support into conversations for several reasons. Firstly, in normal mode Lync screen sharing occurs inside the conversation, whereas in UI Suppression Mode you have to do all the steps in the sharing process yourself with the help of a Lync control, the app SharingView, which is used to display the source that is being shared with the help of a parent window handle.
Here is a short list of what we did to share support.
- Created a window for screen sharing and implemented picture correction when you change the size of the parent window;
- Implemented resources list output (screen, applications, etc.), which are sharable;
- Put objects being shared in frames;
- Added extra features, such as the conference participant control handover (so that you could click on the screen being shared)
Lync sharing (in UI Suppression Mode) is kind of cranky. It likes to fail for whatever reason, and after transferring to SFB 2016 it started failing almost constantly. There’s nothing you can do about the black screen that pops up when sharing since (as described above) it is responsible for playback. Being able to successfully launch sharing also highly depends on the connection speed.
Next we moved on to the last tab ‘Groups’, which would load group lists from Lync and allow users to edit them and sort in the correct order. This tab was supposed to develop into a corporate tab, which would contain pre-created groups in the Active Directory for employees (called Distribution Groups in Lync) like ‘Claim vacation’, ‘Write an application’, etc. Employees responsible for certain in-quiries were seen as participants in those groups. You could chat with or call the first available member of the group by clicking the group icon. The Lync server administrator would be managing these groups.
Of course, we faced a bunch of random issues bringing everything that we had in mind to frui-tion. There was a specific set of issues associated with the incorrect operation of the Lync SDK library in Lync Suppression Mode – we sent them up to Microsoft thinking we could get help finding a solution.
As we accidentally found out, while in UI Suppression Mode you lose integration with Outlook:
- Contact status disappears;
- No way to create a conversation from a contact card;
- ‘Start Skype conference’ button “dumps”.
We managed to reintroduce functioning contact cards to Outlook relying on the information from this article.
We also returned contact statuses, now Outlook receives them from our app, not from Lync. However, it updated them in some magical way, so they would always “fall off” and stop synchroniz-ing. What really happened was the person returned to their workplace and is back online while Out-look still shows them as ‘away’. We contacted Microsoft support, and in response got the link to the article mentioned above. We contacted Yammer Microsoft as well as MSDN and Reddit forums, and so on…. Unfortunately, this problem still exists.
The problem with the dumped ‘Start Skype Conference’ button in Outlook is embedded in overwriting the following registry keys on the route HCU/Software/Microsoft/Office/15.0/Lync/ConfAddin/my sip/ in UI Suppression Mode. There are three keys: Capabilities, InbandInfo, and PublicMeeting. When Lync is in normal mode, you press on the ‘Create Skype conference’ button and Outlook request information on conferences from Lync, which simultaneously creates registry keys. Lync doesn’t want to do that in UI Suppression Mode. You can’t obtain the necessary information from the Lync server by means of Lync SDK 2013. In order to operate directly with the server, we found a different SDK. We obtained information about authorized user conferences from the server through UCMA.
We filled in the registry keys and voila, creating conferences was back on Outlook again. There are several restrictions in this method:
- UCMA library only works on 64-bit OS and not on 32-bit;
- The user’s computer and server must be under the same domain, otherwise you’ll have to create certificates on the server for trusted applications as described here, but this doesn’t work for us as we only implement features on the client’s end.
There were bugs in Lync SDK itself. The most crucial one is that Lync client always fails when adding a third member to p2p video conversation. Microsoft itself acknowledges this bug, but hasn’t established how to get rid of it. There have been attempts to kill the conversation and create a p2p video conference for three persons at once, but if a SFB client adds a third party we can’t interfere. Stopping and restarting the video channel, too, led to nothing.
Another problem arose that left some users (those who had a different version of Lync client) unable to sharing screen. This is what this problem actually looks like:
The first client uses our app (Lync version 2013) and the second one uses SFB 2016, so when the second one opens a conversation with the first one, the screen sharing button is gone. If the first client logs into standard Lync 2013 (not Suppression Mode), the screen sharing button activates for the second client. If both clients uses Lync 2013 (or our app), sharing is available on both sides.
There is no message delivery callback in Lync SDK, only a callback that the message has been sent. It sometimes happens that we send a message to someone who is online, it goes without an ex-ception, but by the time it’s delivered the person on the other end is already offline. Therefore, the sender thinks that the message has been delivered when it really hasn’t.
Often there is ‘ItemNotFoundException’ when receiving a photo of contacts; therefore, we have to show our standard contact image. Through trial and error we found out the number of times (about 3) to call the code to receive the image so Lync would bring it back. However, this method still doesn’t work for some contacts. In addition, we introduced photo caching so that at launch there are no exceptions, if a user had many contacts added.
There is also an issue with groups of users, in particular the ‘Favorites group’. The problem is that when some users call CanInvoke(DeleteGroup), Lync returns true, although this is a standard Lync group and can’t be deleted. This is the same type of group that’s been created by a user (Cus-tomGroup), so hiding the ‘Delete group’ item from the menu has to be done before an additional group name check-up, which is a hard crutch.
Serious limitations were found in Lync SDK 2013:
- One of the important features is unavailable: the ability to set call redirection when the user is offline. We implemented it after an expiration time, but only when the user is online,
During a group video call (3 or more participants), there is only one stream that transmits par-ticipants’ videos (mobile phone conference analogue), meaning that Lync itself changes video streams from different participants depending on who is talking into the microphone.
- File transferring is unavailable in UI Suppression Mode. We solved this problem in 2 ways:
- Added file transfer via Outlook as an attachment to the letter;
- Embedded OneDrive service to upload files to the cloud and to send messages with the file’s URL automatically;
- You can’t use the contextual conversation data (as described here), when the conversation converts to a conference and starts to exist on the server rather than locally. We wanted to use this opportunity to synchronize the various information between clients.
- Typing in the ‘Subject’ field in conference mode is disabled in Lync 2013. Someone on MSDN was complaining that in Lync 2010 had about 30 saved conferences, each with a separate head-ing. After transferring to Lync 2013 they were only left with lists of the members of each con-ference, making it almost impossible to tell one from another.
- Another feature of Lync SDK 2013 is that client support is for Lync 2013 and higher, Lync 2010 is not supported. However, Lync SDK 2010 works with Lync 2010, 2013 and higher. It is unclear what reason Microsoft had for doing that.
During the development process, we realized that we wouldn’t be able to fully implement a complete Lync analogue based on Lync SDK + UCMA in Suppression Mode. Even if you look past the limitations of these technologies, it’s a shame we couldn’t receive Microsoft’s support on how to fix Lync SDK bugs.
We are currently forced to give up on UI Suppression Mode because we are unable to imple-ment all the features, so we are looking for new solutions.
Hopefully, this article will be helpful for junior programmers developing apps on the Lync/Skype for Business platform. Moreover, if you managed to read up until this point and want to share your ideas, please, contact us directly at firstname.lastname@example.org!