Join a Conference Session

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.

Whether a local client obtains a conference URI from an incoming conference invitation or from the OnScheduleConference event, the client must create a new conference session to connect the local user to the conference on the focus.

A local client application obtains a conference session by either scheduling a conference or accepting a conference invitation from a remote client. Once a conference is obtained, the local user enters the conference and connects to the conference media.

For information about scheduling a conference, see Schedule a Conference. For information about accepting a conference invitation, see Accept a Conference Invitation.

Note

An endpoint can only be used to join a single anonymous conference. For each successive anonymous conference to be joined, an additional endpoint must be enabled.

Enter a Conference

The conference session is encapsulated by the IUccConferenceSession and IUccSession interfaces. A conference session object is created using the IUccSessionManager interface. Before calling the CreateSession method, an application obtains the pointer to this interface by querying IUccSessionManager on a user's endpoint object. The application must specify UCC_SESSION_TYPE.UCCST_CONFERENCE as the session type.

Before entering a conference, you must check to see if the conference has been locked or is in an inactive state. The conference session properties include UCC_CONFERENCE_SESSION_PROPERTY.UCCCSPID_LOCKED and .UCCCSPID_ACTIVE. These property values are obtained by reading the BoolValue property exposed by each returned IUccProperty instance. If a local user enters an inactive conference session, the platform immediately raises the OnParticipantRemoved. For information about obtaining properties from UCCP property collections, see Work with Properties and Property Collections.

If a conference session is found to be inactive, setting the .UCCCSPID_ACTIVE property to true does not activate the conference. Attempting to set the property results in an Invalid State COM exception. The conference scheduling user must update conference information properties using a conference manager session to activate the conference.

  • The resultant session object must be cast into type IUccConferenceSession before calling the Enter method, which sends to the server a request to join the specified conference.
  • After finishing processing the request to join a conference, the server returns the operational status in an OnEnter event. The application must catch this event to determine whether the user has joined the conference successfully.
  • Only after the user has entered the conference successfully is the user ready to participate in the conference; that is, to hear, speak to, or send instant messages to other participants in the conference, to view or manage the meeting roster, or to inspect the conference settings. The application typically performs these tasks as part of handling the OnEnter event.

In production code, an application also needs to implement other methods of _IUccConferenceSessionEvents. For the purpose of testing joining a conference, other methods can have empty implementations.

The following example joins a conference.

/// <summary>
/// Create and enter new conference session with passed conference URI
/// </summary>
/// <param name="pConferenceURI">string conference URI</param>
/// <returns>Boolean true if entered conference</returns>
private Boolean EnterNewConference(string pConferenceURI)
{
    Boolean returnValue = false;

    // this.mySessionManager is instance of IUccSessionManager interface obtained from local endpoint (IUccEndpoint)
    this.mySession = this.mySessionManager.CreateSession(
        UCC_SESSION_TYPE.UCCST_CONFERENCE,
        null);

    // Cast IUccSession to IUccConferenceSession.
    // this.myConferenceSession is private class field instance of IUccConferenceSession.
    this.myConferenceSession = this.mySession as IUccConferenceSession;


    // Advise for conference session events, particularly OnEnter.
    UCC_Advise<_IUccConferenceSessionEvents>(this.myConferenceSession, this);

    UccUriManager uriManager = new UccUriManagerClass();

    // Convert conference uri string into UccUri instance.
    // this.myConferenceUri is private class field instance of UccUri.
    this.myConferenceUri = uriManager.ParseUri(pConferenceURI);


    // Create operation context to be passed to the Enter method.
    UccOperationContext EnterOpcontext = new UccOperationContextClass();
    UccContext context = new UccContextClass();
    EnterOpcontext.Initialize(1, context);

    try
    {

        Boolean conferenceActive = false;
        Boolean conferenceLocked = false;
        if (this.myConferenceSession.Properties.IsPropertySet((int)UCC_CONFERENCE_SESSION_PROPERTY.UCCCSPID_LOCKED)== true)
        {
            conferenceLocked =  this.myConferenceSession.Properties.get_Property((int)UCC_CONFERENCE_SESSION_PROPERTY.UCCCSPID_LOCKED).BoolValue;
        }
        if (this.myConferenceSession.Properties.IsPropertySet((int)UCC_CONFERENCE_SESSION_PROPERTY.UCCCSPID_ACTIVE) == true) 
        {
            conferenceActive = this.myConferenceSession.Properties.get_Property((int)UCC_CONFERENCE_SESSION_PROPERTY.UCCCSPID_ACTIVE).BoolValue;
        }
        if (conferenceActive == true && conferenceLocked == false)
        {

            this.myConferenceSession.Enter(this.myConferenceUri, EnterOpcontext);
            returnValue = true;
        }
    }
    catch (COMException e)
    {
        if (e.ErrorCode == (int)ConferenceOperations.JoinSuccess)
        {
            MessageBox.Show("Local user joined conference");
        }
        else
        {
            throw new Exception("Conference enter failed: " + e.Message);
        }
    }
    return returnValue;


}

A client must handle the OnEnter event to complete the process for the user to join the conference. The user is not in the conference until a succeeded code (StatusCode>=0) is returned. For the client to be notified of this and other conference session-related events, the application must register for appropriate dispinterfaces. The previous example code registered for all the conference session related events: _IUccSessionEvents, _IUccConferenceSessionEvents and _IUccSessionParticipantCollectionEvents.

Connect to Conference Media

The conference media used in a conference for collaboration is exposed in a additional conference-related sessions that must be created by the local client in order to participate in a session. For information about creating these additional sessions, see Obtain Conference Media.

See Also

Concepts

Obtain Conference Media
List Conference Participants
Leave a Conference