Microsoft Lync and Skype for Business have a rich set of .NET APIs which make it easy to extend the platform and integrate it with other applications. This blog helps explain how to use those APIs.

Watching for conference recording in UCMA

Posted: June 21st, 2013 | Author: | Filed under: UCMA 3.0, UCMA 4.0 | Tags: , | No Comments »

In the Lync client, if you are participating in a conference and someone starts recording, you get notified: a red dot appears near the bottom of the window, and a message pops up letting you know that recording has started. How do you get the same kind of notification in a UCMA application?

If you look for an event that is triggered when someone begins recording a conference, you will likely be frustrated. There’s no RecordingStateChanged or RecordingStarted event or anything like that, as you might expect. There is actually a very simple way to be notified of recordings, but it is not at all obvious from looking through the events on the various UCMA classes.

The event you want is not on any conference-related class at all, but rather on the Conversation class – specifically, the Conversation.ParticipantPropertiesChanged event.

Since the built-in conference recording in Lync is exclusively a client-side feature, the state of recording is naturally tracked for each client participating in the conference. Conversation.RemoteParticipants contains a collection of ConversationParticipant objects representing the remote users involved in the conversation (in this case, a conference), and each one has an IsRecording property.

Since you don’t want to have to constantly check this property, you need to hook up an event handler to Conversation.ParticipantPropertiesChanged:

_conversation.ParticipantPropertiesChanged +=
    OnParticipantPropertiesChanged;

This event handler can then check for cases where the IsRecording property has changed, and whether the participant is now recording or not:

void OnParticipantPropertiesChanged(object sender,
    ParticipantPropertiesChangedEventArgs e)
{
    if (e.ChangedPropertyNames.Contains("IsRecording"))
    {
        if (e.Properties.IsRecording == true)
        {
            Console.WriteLine("Recording started for {0}!",
                e.Participant.DisplayName);
        }
        else
        {
            Console.WriteLine("Recording stopped for {0}!",
                e.Participant.DisplayName);
        }
    }
}

Based on this information, it can do whatever it is that you need to do to react to people recording your conference.

Hope this helps someone else avoid a few hours of fruitlessly poring through the API docs. Let me know if you have questions.



Leave a Reply

  • Note: Comment moderation is in use because of excessive spam. Your comment may not appear immediately.

  •