Session Creation

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.

Sessions are created and maintained with a session manager. The session manager is encapsulated by the IUccSessionManager interface in Unified Communications Client API. An application can obtain a pointer to this interface by calling QueryInterface on an IUccEndpoint object. In C#, this amounts to casting an IUccEndpoint object into an IUccSessionManager object.

In C#, querying the interface amounts to casting an object as the interface type.

After a session is created, the endpoint is included as the local participant of the session. The local participant can start to communicate with other registered users by inviting them to this session. For more information, see Session Participants.

When the session object is no longer needed, an application should exit the session by calling the Terminate method. This ensures that resources used by the session object are properly cleared. All calls to CreateSession should be balanced by a call to Terminate, even if no activities occur between each call.

Session Properties

When creating a session, an application can optionally specify various session properties as a collection of name-value pairs. This collection is known as the session context. Unified Communications Client API provides the UccContext co-class that can be created directly and cast to the IUccPropertyCollection interface. As a property collection, you have access to the name-value pair functionality needed to provide context information in a session.

The supported session properties are enumerated in the UCC_SESSION_CONTEXT type.

Session Events

After a session is created, an application typically registers for events raised by the newly created session object. These events are defined by the _IUccSessionEvents and _IUccSessionParticipantCollectionEvents interfaces. The events defined in the _IUccSessionEvents interface are used to monitor the status of certain session operations. The events defined by the _IUccSessionParticipantCollectionEvents interface can be used to track the changes of the participants in a session. In an IM session, the application should register for events defined by _IUccInstantMessagingSessionEvents. Similarly, the application might want to register for events defined in _IUccAudioVideoSessionEvents in an AV session or register for events defined in _IUccConferenceSessionEvents for a conference session.

To register session events, a client can call a wrapper method like the UCC_Advise<T> function.

The object implementing endpoint functionality must also implement the _IUccSessionEvents and _IUccSessionParticipantCollectionEvents interfaces.

Before exiting a session, if the application does not cancel the event registrations with that session, memory leaks can occur.

For more information about the UCC_Advise<T> function, see Advise for and Handle Events in a Unified Communications Client API Client.

See Also

Concepts

Endpoint Object
Session Types
Session Participants