Conference Manager Sessions

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 client uses the conference manager session to create, modify, or delete a conference on a Focus Factory. A client should establish a single conference manager session to handle all scheduling tasks. Unlike collaboration sessions, the conference manager session is obtained from a conference manager instance rather than a session manager instance.

An instance of IUccConferenceManager is implemented by an IUccEndpoint instance. In a C++ environment, call QueryInterface on the endpoint to get the conference manager. IUccConferenceManager is obtained by casting the endpoint to an interface in C#. The CreateConferenceManagerSession method creates a conference manager session object that provides conference management methods such as conference scheduling. To get the conference manager, we recommend the OnEnable callback method.

To obtain a conference manager session from a conference manager, a client must get the Focus Factory URI that creates conference Focus instances on a server. This URI is passed to a client in the response to a server configuration query. The query returns an instance of the IUccServerConfigurationCategory interface that includes the FocusFactory property. For information about configuration properties and methods, see Query Office Communications Server Configuration.

A conference manager session object provides the functionality to perform all conference management operations. Each possible operation is encapsulated by a specific method call on the IUccConferenceManagerSession object. All method calls are asynchronous and callback functions should be implemented for each method within the _IUccConferenceManagerSessionEvents interface. Method results on the IUccConferenceManagerSession object are returned in these events. The return values are used for supplemental operations or to determine the success or failure status of an operation.

Getting the Conference Manager Session Interface

The following code example represents a class constructor method in an application that creates a class to encapsulate all conference management functionality. This constructor does the following:

  • Obtains the IUccConferenceManagerSession interface with a cast.
  • Registers the conference manager session events.
  • Requests a list of multipoint control units (MCUs) and scheduled conferences.

In the following example, a class that handles both session manager and conference manager session events is declared. The session manager event, OnIncomingSession, is used to catch incoming conference invitations. The conference manager session event, OnScheduleConference, is used to get the conference Focus URI that is returned by the Focus Factory when a local user creates a conference. The event callback method can also be used to initiate the process of inviting remote users.

Note

The declarations are private class fields that are located in the application class responsible for creating conferences.

using System;
using System.Text;
using Microsoft.Office.Interop.UccApi;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Xml;


namespace Conferences
{

    public class Conference : 
        _IUccSessionManagerEvents, 
        _IUccSessionDescriptionEvaluator,
        _IUccConferenceManagerSessionEvents,
        IDisposable
    {
        private IUccSessionManager mySessionManager;
        private IUccConferenceManagerSession myConfManagerSession = null;
        private IUccConferenceManager myConferenceManager = null;
        private List<object> _conferenceInviteeList = null;
        private List<String> _acceptAppSessionList = new List<string>();
        private string myConferenceUri = string.Empty;
        private UCCPPlatformManager myPlatform;
        private Boolean disposed = false;
        private UCCPSession newAppSession;
        private Dictionary<string, IUccConferenceInformation> confIdDict;

        //... class methods
    }
}

In the next example, the constructor for the previous class declaration uses the endpoint parameter and server configuration category to create a conference manager and conference manager session. This constructor should be called by a custom application after the application queries for server configuration and receives a response to the query in the OnCategoryInstanceAdded event. The constructor takes the IUccServerConfigurationCategory that is returned to the client in the category instance event.

The constructor calls the GetAvailableMcuList method. The Conference class handles the asynchronous OnGetAvailableMcuList method response. The response provides a list of the modality-specific MCU instances that are provided by a Focus that is created by the Focus Factory.

public Conference (
     IUccEndpoint pEndpoint,
     IUccServerConfigurationCategory ServerConfiguration)
{
    string focusFactoryURI = ServerConfiguration.FocusFactory;
    InitializeComponent();
    this._endpoint = pEndpoint;
    this.myConferenceManager = this._endpoint as IUccConferenceManager;
    this.myConfManagerSession = this. myConferenceManager.CreateConferenceManagerSession(focusFactoryURI);
    UCC_Advise<_IUccConferenceManagerSessionEvents>(this.cmyConfManagerSession, this);
    try
    {
        if (this.myConfManagerSession != null)
        {
            this.myConfManagerSession.GetAvailableMcuList(null);
        }
    }
    catch (COMException CE)
    {
        Console.WriteLine("COM Exception on GetAvailableMCUs " +
                          CE.ErrorCode.ToString());
    }
}

If you are using C++, obtain the conference manager interface with the following approach.

IUccConferenceManager* pConferenceManager;
HRESULT hr = pEndpoint->QueryInterface(IID_IUccConferenceManager, 
                                       (void**)&pConferenceManager);

Conference Manager Session Events

The events raised by a conference manager session provide asynchronous responses from a Microsoft Office Communications Server instance to operations that are initiated by a custom client. The events can return requested items such as supported multipoint control units (MCUs), conferences created on the Focus Factory, a single conference, or operational status for operations where a conference is added, modified, or deleted.

On Get Conference List

In the following example, the event handler loads the conference Id values as strings into a List object that is used by other class methods.

To maintain a list of scheduled conference objects, the application declares a generic dictionary structure. The dictionary structure key is the conference URI and the value is an object of the IUccConferenceInformation type.

void _IUccConferenceManagerSessionEvents.OnGetConferenceList(
                                         UccConferenceManagerSession pEventSource,
                                         IUccOperationProgressEvent pEventData)
{
    if (pEventData.StatusCode >=0)
    {
        IUccCollection myConferences;
        conferences = new List<string>();
        try
        {
            IUccReadOnlyPropertyCollection rp = pEventData.Properties;
            IUccProperty p = rp.get_Property(
                                           (int)UCC_CONFERENCE_MANAGER_OPERATION_COMPLETED_EVENT_PROPERTY
                                           .UCCCMOCEP_CONFERENCE_LIST);
            myConferences = p.Value as IUccCollection;
            if (myConferences != null)
            {
                foreach (IUccProperty pProperty in myConferences)
                {
                    IUccConferenceInformation ci = pProperty.Value as IUccConferenceInformation;
                    confIdDict.Add(ci.ConferenceUri.Value, ci);
                }
            }
        }
        catch (Exception e)
        {
             Console.WriteLine(e.Message);
        }
    }
    else
        Console.WriteLine("OnGetConferenceList" + pEventData.StatusText);
}

On Delete Conference

This callback function provides the IUccOperationProgressEvent interface needed to perform actions for an individual conference. The example, OnDeleteConference, uses the OriginalOperationContext property to get the URL of the conference, locate a list box entry, and then remove the entry.

void _IUccConferenceManagerSessionEvents.OnDeleteConference(
                                         UccConferenceManagerSession pEventSource,
                                         IUccOperationProgressEvent pEventData)
{
    // Check to see if delete conference request is complete.
    if (pEventData.StatusCode >= 0)
    {
        IUccOperationContext oc = pEventData.OriginalOperationContext;
        IUccContext c = oc.Context;
        IUccProperty p = c.get_NamedProperty("SIP");

        string confURI = p.StringValue;

        // Using conference URI, find matching entry in UI conference list box.
        int i = conferenceList.FindStringExact(confURI, -1);

        // If found, use returned index value to remove entry from list.
        if (i >= 0)
            conferenceList.Items.RemoveAt(i);
    }
}

On Get Available MCUs

While creating a new conference on a Focus Factory, the client must obtain a collection of supported MCU instances from the Focus Factory. Each MCU represents a session modality that is supported by a new Focus generated by the Focus Factory. For example, a Focus Factory may return a single MCU representing the IM modality. In this case, Focus instances created by the factory can only be IM conferences. With this callback function, IUccCollection obtains all available MCUs that are needed to schedule a conference.

Important

To maintain compatibility with Office Communications Server, a client should ignore MCU types it does not recognize.

void _IUccConferenceManagerSessionEvents.OnGetAvailableMcuList(
                                         UccConferenceManagerSession pEventSource,
                                         IUccOperationProgressEvent pEventData)
{ 
    if (pEventData.StatusCode >=0)
    {
        IUccReadOnlyPropertyCollection mcuCollection = pEventData.Properties;
        IUccProperty availableMCUs = mcuCollection.get_Property(
        (int)UCC_CONFERENCE_MANAGER_OPERATION_COMPLETED_EVENT_PROPERTY.UCCCMOCEP_AVAILABLE_MCUS);

        try
        {
            IUccConferenceView convView = availableMCUs.Value as IUccConferenceView;

            foreach (IUccConferenceEntityView MCU in convView.Entities)
            {
                MessageBox.Show("MCU " + MCU.Type.ToString());
            }
        }
        catch (InvalidCastException)
        { }
    }
}

On Get Conference

This callback function provides the IUccConferenceInformation object for the requested conference.

void _IUccConferenceManagerSessionEvents.OnGetConference(
                                         UccConferenceManagerSession pEventSource,
                                         IUccOperationProgressEvent pEventData)
{
    // Check to see if delete conference request is successful.
    if (pEventData.StatusCode >= 0)
    {
        
      // Create integer value for conference information enumeration value.
        int cIEnum = (int)UCC_CONFERENCE_MANAGER_OPERATION_COMPLETED_EVENT_PROPERTY.
                      UCCCMOCEP_CONFERENCE_INFORMATION;

     // Get conference information property from the operation progress interface.
       IUccProperty cp = pEventData.Properties.get_Property(
                                               cIEnum);

     // Cast property value to conference information interface.
       IUccConferenceInformation ci = cp.Value as IUccConferenceInformation;

     // Conference information property is used to obtain the conference URI.
     //and conference Id of the returned conference. 
}

On Schedule Conference

This event returns the new conference after a Focus Factory processes a request to create a conference. If the conference is created, the StatusCode value is greater than or equal to zero.

void _IUccConferenceManagerSessionEvents.OnScheduleConference(
                                         UccConferenceManagerSession pEventSource,
                                         IUccOperationProgressEvent pEventData)
{
    if (pEventData.StatusCode >= 0)
    {
        IUccProperty property = null;

        UccOperationContext oc = pEventData.OriginalOperationContext;
        property = null;
        // Get operation context named property for conference Id.
        string confId = string.Empty;
        if (oc.Context.IsNamedPropertySet("ConferenceID"))
        {
            property = oc.Context.get_NamedProperty("ConferenceID");
            if (property != null)
                confId = property.StringValue;
        }
        
        property = null;
        int propEnum = (int)UCC_CONFERENCE_MANAGER_OPERATION_COMPLETED_EVENT_PROPERTY
            .UCCCMOCEP_CONFERENCE_URI;
        property = pEventData.Properties.get_Property(propEnum);


        if (property != null)
        {

            // If caller registered for this public event, then call the event.
            if (this._conferenceScheduled != null)
            {
                // Raise event with new Focus URI and conference Id.
                // The callback function in calling code that handles this
                // event can begin to invite remote users to this conference.
                this._conferenceScheduled(property.StringValue, confId);
            }
        }
    }
}

On Modify Conference

This event is returned after a Focus Factory processes a request to modify a conference. The operation progress event parameter provides the updated conference information instance.

void _IUccConferenceManagerSessionEvents.OnModifyConference(
                                         UccConferenceManagerSession pEventSource,
                                         IUccOperationProgressEvent pEventData)
{
    if (pEventData.StatusCode >= 0)
    {
      // Create integer value for conference information enumeration value.
        int cIEnum = (int)UCC_CONFERENCE_MANAGER_OPERATION_COMPLETED_EVENT_PROPERTY.
                      UCCCMOCEP_CONFERENCE_INFORMATION;

     // Get conference information property from the operation progress interface.
       IUccProperty cp = pEventData.Properties.get_Property(
                                               cIEnum);

     // Cast property value to conference information interface.
       IUccConferenceInformation ci = cp.Value as IUccConferenceInformation;

     // Conference information property is used to obtain the conference URI
     // and conference Id of the returned conference.
    }
}

See Also

Concepts

Schedule a Conference