Share via


Create an Audio 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.

To begin an audio/video (AV) call, a Unified Communications Client API application creates an AV session. It does so by calling the CreateSession method on a session manager (IUccSessionManager) object. With two exceptions, this process is identical to the one used for creating an IM session. The two exceptions are:

The following C# code snippet illustrates the process for creating an AV session using Unified Communications Client API.

IUccEndpoint endpoint = ...
IUccSessionManager sm = endpoint as IUccSessionManager;
UCC_Advise<_IUccSessionManagerEvents>(sm, smEventHandler);

// Create IUccSession and store reference in private class field.
// New context object.
UccContext sessionContext = new UccContext();

// Create GUID to uniquely identify session.
string _ConversationGUID = System.Guid.NewGuid().ToString();

// Assign GUID string as session property.
// 10000 is a reserved value that causes the platform
// to insert the GUID into the outgoing session invitation.
sessionContext.AddProperty(10000, _ConversationGUID);

IUccSession session = sm.CreateSession(
                      (UCC_SESSION_TYPE.UCCST_AUDIO_VIDEO, sessionContext);
UCC_Advise<_IUccSessionEvents>(session, this);
UCC_Advise<_IUccAudioVideoSessionEvents>(session, this);
UCC_Advise<_IUccSessionParticipantCollectionEvents>(session, this);

See Also

Concepts

Handling Session Invitations
Conducting an Audio/Video Session
Invite a Participant to an Audio/Video Session
Handle Audio Session Events
End an Audio/Video Session