Walkthrough: Start an Automation Audio Conversation (Lync 2010 SDK)
This topic shows how to start an audio conversation using .NET Framework managed code with Microsoft Lync 2010 SDK.
Prerequisites
For a list of prerequisites, see Walkthrough: Start an Instant Message Conversation (Lync 2010 SDK).
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
Sign in to Microsoft Lync 2010.
In Microsoft Visual Studio development system, create a new Windows Forms application.
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.
Add a reference to the assembly Microsoft.Lync.Model.
In Form1.cs add the following using statement.
using Microsoft.Lync.Model; using Microsoft.Lync.Model.Extensibility;
In the Form1_Load event handler add the following 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);
Build and run the application.
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
Lync Extensibility API Conversation Walkthroughs (Lync 2010 SDK)