Share via


List Conference Participants

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

A Unified Communications Client API application should maintain a conference roster to provide current conference participant presence for the local user. Presence information helps the local user identify who has joined or left a conference.

After a user joins a conference, OnEnter is raised on every client participating in the conference. To update a conference roster, the Unified Communications Client API application can examine a list of conference participants by enumerating the participant collections and examining the property of each participant.

Important

OnEnter is raised on the local client when a conference participant enters the conference. The callback parameters of this event handler do not provide the identity of the user or the action that triggered the event. For this reason, a client should use this event to iterate over the entire list of conference participants and completely replace the conference roster.

The participant collection is retrieved using the Participants property of the conference session object. The properties of each participant, for example, the display name of a participant, are retrieved using the Properties property of the conference session participant object.

Supported property types are defined in the UCC_CONFERENCE_PARTICIPANT_PROPERTY enumeration type. For each conference participant object, some properties do not have values assigned to them.

To retrieve a property value, a Unified Communications Client API application calls the get_Property method on the Properties collection of the conference session participant and then specifies a member of the UCC_CONFERENCE_PARTICIPANT_PROPERTY type as the property ID.

The following example enumerates the list of conference participants.

public partial class Conference : 
        _IUccConferenceSessionEvents 
{

    public Conference(IUccConferenceSession pConferenceSession)
    {
        UCC_Advise<_IUccConferenceSessionEvents>(pConferenceSession, this);
    }
    void _IUccConferenceSessionEvents.OnEnter(
        UccConferenceSession pEventSource, 
        IUccOperationProgressEvent pEventData)
    {
        if (pEventData.IsComplete == true)
        {
            this.GetParticipantNames(pEventSource);
        }
    }

    /// <summary>
    /// Returns string representation of all participant names and their status
    /// </summary>
    /// <returns> String representation of all participants in the conference and their status</returns>
    private string GetParticipantNames(UccConferenceSession pSession)
    {
            StringBuilder strBldr = new StringBuilder();

            try
            {

            IUccSession confSession = pSession as IUccSession;
            foreach (IUccSessionParticipant p in confSession.Participants)
            {
                IUccConferenceSessionParticipant confParticipant = (IUccConferenceSessionParticipant)p;

                try
                {
                    string displayName = confParticipant.Properties.get_Property((int)UCC_CONFERENCE_PARTICIPANT_PROPERTY.UCCCPPID_DISPLAY_NAME).StringValue;
                    strBldr.AppendLine(displayName);
                }
                catch (COMException ex)
                {
                    MessageBox.Show("No display name found." + ex.ToString());
                    continue;
                }
            }
            return strBldr.ToString();
        }
        catch (COMException ex)
        {                
            MessageBox.Show(ex.ToString());
            return strBldr.ToString();
        }
    }
    
}

See Also

Concepts

Join a Conference Session
Obtain Conference Media
Leave a Conference