Conversation modalities

Lync 2013

Core concepts

Learn about how Microsoft Lync 2013 SDK represents the communication modes in a Microsoft Lync 2013 conversation.

Last modified: April 09, 2013

Applies to: Lync 2013 | Lync Server 2013

A Lync 2013 conversation can let people converse in any combination of several modes, including modes that let a user share their desktop, a running program, a virtual whiteboard, or an Office document such as a PowerPoint slide deck. Each of these modes share features and operations that are encapsulated by the base Microsoft.Lync.Model.Conversation.Modality class. These include the modality state, hosting endpoint, and owning participant. Common modality operations include invitation acceptance, invitation rejection, modality connection, and modality rejection.

Each specific conversation mode, such as the IM mode or the audio-video mode, is encapsulated by a class that inherits the base Microsoft.Lync.Model.Conversation.Modality class and then exposes properties, methods, and events that are specific to the modality. For example, the Microsoft.Lync.Model.Conversation.InstantMessageModality class exposes the InstantMessageModality.BeginSendMessage(String, AsyncCallback, Object) method so that you can send IM messages on the modality. The following table lists the conversation modality classes in the Lync 2013 API.


Conversation mode


The base modality class.


The instant message modality class. Inherits from Modality.


The audio-video modality. This modality is used for audio conversations, audio-video conversations, audio conferences (online meetings), and audio-video conferences. Inherits from Modality.


The application sharing modality. This modality is used to share a user’s desktop, computer display, or running program. Inherits from Modality.


The content sharing modality. This modality is used to upload and annotate virtual whiteboards, PowerPoint slide decks, and meeting attachments.

The success of operations such as sending IM messages, holding and retrieving audio calls, transferring, and forwarding calls depend on the state of a modality at the time the operation is attempted. Some operations are not allowed on modalities even when the state of the modality is valid. For example, because InstantMessageModality inherits the methods of Modality, it is syntactically correct to call the Modality.BeginTransfer method on it. However, doing so raises an UnauthorizedAccessException. Instead of requiring that a developer learn about all of the scenarios where an operation is not allowed on a modality, Microsoft Lync 2013 SDK provides the Modality.CanInvoke method. If you pass the modality action that you are going to try, the method returns true if the action is available. CanInvoke checks the state and type of the modality for you and then returns false if you cannot perform the action.

A Conversation object exposes a modality collection that always includes every modality in the previous table. The modalities in this collection represent the SIP and medial dialog between the local user’s endpoint and either another user or a meeting focus. The conversation also exposes a collection of Microsoft.Lync.Model.Conversation.Participant objects. These participant objects represent the other people who are participating in the conversation. Each Participant object exposes a complete collection of modalities. The modalities in a participant’s collection represent the relationship between the local user and the participant who owns the modality object. These modalities are normally used to start modality operations that affect only the local user and the participant on the other end of the relationship.

By default, InstantMessageModality is in a F:Microsoft.Lync.Model.Conversation.ModalityState.Connected state when a conversation is created. This means that you can send and receive IM text as soon as a conversation starts. The exception to this rule is where one or more of the conversation endpoints is incapable of rendering or capturing IM text. For example, an audio conversation between a Lync 2013 client and a person using a public switched telephone network (PSTN) telephone. As long as all endpoints in a conversation support a given modality, you can activate the modality by calling the Modality.BeginConnect method. When connected, you can use the conversation mode encapsulated by the modality.