Handle Audio Session Events

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.

In the course of a session, several classes of session-related events can be raised. The Unified Communications Client API client must be equipped to handle these events to be a fully featured communications client. By registering event handlers for these session events, the Unified Communications Client API client meets this requirement.

Audio/Video Session Event Classes

The following classes of events can be raised in the course of a session:

  • Audio/Video Session Participant Events: These events are raised when a participant makes a media channel related request. For example, a participant wants to add video to an audio only conversation.
  • Audio/Video Session Events: A session participant has published session metrics. Publishing session metrics amounts to gathering call quality metrics data and sending that data to an URI specified in the QualityMonitoringServerUri property of the server configuration interface at the conclusion of the audio session.
  • Audio Media and Audio/Video Media Channel Events: These events can be raised in relation to audio level, media stream state, or media source changes. In addition, events are raised when media channels are added or removed. If a local media device changes, an event is raised.
  • General Session Events: Events in this class can be raised due to actions by a local client such as requests to add a participant to a session. Events can also be raised that are due to changes made remotely. For example, a remote user accepts an invitation to join an audio session. Events in this class are either session participant related or participant endpoint related.

Example

The following C# example illustrates handing events in the session participant collection events class.

When a session participant is added to the collection of session participants, the code snippet registers an event handler for that specific session participant. When session participants are removed from the collection, the event handler for each session participant is unregistered.

For more information, see _IUccSessionParticipantCollectionEvents.

#region _IUccSessionParticipantCollectionEvents

 void _IUccSessionParticipantCollectionEvents.OnParticipantAdded(
      IUccSession session,
      IUccSessionParticipantCollectionEvent eventData)
 {
 // A participant has been added to the session
 // by the local or a remote participant
    IUccSessionParticipant participant = eventData.Participant;

    UCC_Advise<_IUccSessionParticipantEvents>(participant, this);

 }

 void _IUccSessionParticipantCollectionEvents.OnParticipantRemoved(
      IUccSession session,
      IUccSessionParticipantCollectionEvent eventData)
 {
   // A participant has been removed from the session
  // by the local or a remote participant
     IUccSessionParticipant participant = eventData.Participant;
     UCC_Unadvise<_IUccSessionParticipantEvents>(participant);
 }

#endregion _IUccSessionParticipantCollectionEvents

See Also

Concepts

Create an Audio Session
Invite a Participant to an Audio/Video Session
End an Audio/Video Session