Channels in Media 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 media channel is a connection between a pair of participant endpoints and is used to transmit streaming media between two participants in a session. There can be multiple channels in a session and there can be multiple channels between a pair of participant endpoints in a session. For example, two participants in a video chat have an audio channel and a video channel between them. In an audio conference involving N participants, there are N audio channels.

Media Channel Interfaces

In Unified Communications Client API, a media channel is represented by an object implementing the IUccMediaChannel interface plus IUccAudioMediaChannel, IUccVideoMediaChannel, or both.

In an audio session, for two participants to connect and then send and receive audio feeds, one participant creates an audio/video session, creates (CreateParticipant) a participant, creates (CreateChannel) and adds (AddChannel) an audio media channel to the remote participant, and then adds the remote participant (AddParticipant) to the newly created session. This process sends an invitation to the remote participant. If the remote participant accepts the invitation (in the OnIncomingSession event handler), the connection becomes established, the channel opens, and media flow follows, provided that both endpoints are equipped with the required media devices (such as sound cards, microphones, or both). An application can set the media flow direction in a channel if the remote participant can listen, talk, or both. This is done by setting the PreferredMedia property on the media channel.

To add another media channel (for example, a video channel) to an existing audio/video session containing an audio channel, a participant creates a new media channel and adds it to the remote participant. The channel starts to open after the application calls the UpdateChannels method on the remote participant and the remote participant accepts the invitation.

To change an existing media channel, an application first retrieves the channel object from the Channels collection on the remote participant object, makes changes (for example, resetting the media directions) to the channel, and then calls the UpdateChannels method on the remote participant.

Media Privacy

A Unified Communications Client API application can choose to encrypt the media transmitted over media channels to help enhance media privacy. The application can do so by setting the SetEncryptionParameters property. The encryption parameters include encryption level and encryption mode. The supported values of an encryption level are defined in UCC_MEDIA_ENCRYPTION_LEVEL. The supported encryption modes are specified in UCC_MEDIA_ENCRYPTION_MODES.

IUccAudioVideoSession avSession = ...; //Assume an active AV session.
avSession.SetEncryptionParameters(
          UCC_MEDIA_ENCRYPTION_LEVEL.UCCMEL_REQUIRED,
          (int)(UCC_MEDIA_ENCRYPTION_MODES.SRTP | UCC_MEDIA_ENCRYPTION_MODES.DES
);

In this code snippet, when encryption parameters are set as shown, the AV session cannot be created if the remote application does not support the encryption.

For an outgoing A/V session, the application can set the encryption parameters when creating the session. For an incoming A/V session, the application can change the encryption parameters before accepting the session invitation.

In the situation where one client does not require encryption, but the other client does, setting the security level to be UCC_MEDIA_ENCRYPTION_LEVEL.UCC_MEDIA_ENCRYPTION_LEVEL.UCCMEL_OPTIONAL ensures that the session is always allowed.

When no encryption is required, the encryption level can be set as UCC_MEDIA_ENCRYPTION_LEVEL..UCCMEL_NONE.

If the application does not specify the security level for a particular media type, Unified Communications Client API uses UCC_MEDIA_ENCRYPTION_LEVEL.UCCMEL_OPTIONAL as the default encryption level.

Before a Unified Communications Client API application receives notification of an incoming session, the security level of the incoming session is checked against the application's required security level. If the security levels do not match, the Unified Communications Client API automatically declines the session without notifying the application. This happens only if one party has an encryption level of UCC_MEDIA_ENCRYPTION_LEVEL.UCCMEL_REQUIRED and the other party has an encryption level of UCC_MEDIA_ENCRYPTION_LEVEL.UCCMEL_NONE.

See Also

Concepts

Conducting an Audio/Video Session