Avaya Client SDK

< Back to Package Overview

Monitoring Participant Events

Using the Client SDK, you can easily monitor participant related events in a conference call.

For monitoring events related to the conference Participant (e.g., new participants joining the conference or participants dropping from the conference), you can define an object that implements the participants event handlers.

Implement participants event handlers

To monitor participants joining or leaving a conference, implement the participants event handlers Conference object. The event conference.ParticipantsChanged provides notifications whenever there is a change in the list of the active participants (ActiveParticipant).

class AppConferenceDelegate{

    public void OnConferenceParticipantsChanged
    (object sender, DataCollectionChangedEventArgs e)
    {
        // Called to report that there is a change in the list of the 
        // active participants. DataCollectionChangeType indicates the type  
        // of changes in the list (i.e. added, updated, deleted or cleared).

        Conference conference = (Conference)sender;
        int newCount = conference.Participants.Count;

        switch (e.ChangeType)
        {
            case DataCollectionChangeType.ItemsAdded:
                foreach (ActiveParticipant participant in e.ChangedItems)
                {

                }
                break;

            case DataCollectionChangeType.ItemsUpdated:
                foreach (ActiveParticipant participant in e.ChangedItems)
                {

                }
                break;

            case DataCollectionChangeType.ItemsDeleted:
                foreach (ActiveParticipant participant in e.ChangedItems)
                {

                }
                break;

            // The changedParticipants is an array of ActiveParticipant 
            // objects that have changed.
            // Add code to update application UI for added/updated/deleted
            // participants.
            case DataCollectionChangeType.CollectionCleared:
                break;
        }
    }
}

Add conference delegate implemetation to Conference

To monitor changing of active participants for the conference, instantiate a conference handler (AppConferenceDelegate) and add it as a delegate to the Conference object.

AppConferenceDelegate conferenceDelegate = new AppConferenceDelegate();
call.Conference.ParticipantsChanged += 
new EventHandler>
(conferenceDelegate.OnConferenceParticipantsChanged);