This topic demonstrates how to start an audio conversation using .NET managed code with Microsoft Lync 2010 SDK.

Prerequisites

For a list of prerequisites, see Walkthrough: Start an Instant Message Conversation .

Creating the Audio Conversation Application

To start an audio conversation, get a Microsoft.Lync.Model.Extensibility . . :: . . Automation object, create IEnumerable objects to contain a URI or a phone number, set instances of Microsoft.Lync.Model.Extensibility . . :: . . AutomationModalities and Microsoft.Lync.Model.Extensibility . . :: . . AutomationModalitySettings , and then call the Automation . . :: . . BeginStartConversation method.

To create the audio conversation application

  1. Sign in to Microsoft Lync 2010.

  2. In Microsoft Visual Studio development system, create a new Windows Forms application.

  3. Select .NET Framework 3.5 or 4.0 as the target framework. For more information, see the MSDN topic How to: Target a Specific .NET Framework.

  4. Add a reference to the assembly Microsoft.Lync.Model.

  5. In Form1.cs add the following using statement.

      Copy imageCopy Code
    using Microsoft.Lync.Model;
    using Microsoft.Lync.Model.Extensibility;
    
  6. In the Form1_Load event handler add the following code.

      Copy imageCopy Code
    // Create the major API automation objects.
    Automation _Automation = LyncClient.GetAutomation();
    
    // Create a dictionary object to contain UiaConversationContext
    data pairs.
    Dictionary<AutomationModalitySettings, object>
    _ModalitySettings = new Dictionary<AutomationModalitySettings,
    object>();
    
    
    // Create a generic List object to contain the URI to call.
    // Edit this to provide a valid URI.
    List<string> inviteeList = new List<string>();
    inviteeList.Add("elise@contoso.com");
    
    // Start the conversation.
    IAsyncResult ar = _Automation.BeginStartConversation(
    	AutomationModalities.Audio
    	, inviteeList
    	, _ModalitySettings
    	, null
    	, null);
    
    _Automation.EndStartConversation(ar);
    
    
  7. Build and run the application.

  8. Hear the ringtone from Microsoft Lync 2010 on the calling computer. See the accept call request on the computer you called.

See Also

Other Resources