How to: Start Automation Audio Conversations
[This is preliminary documentation and is subject to change.]
This topic shows how to start an audio conversation using .NET Framework managed code with Microsoft Lync 2013 Preview SDK.
For a list of prerequisites, see How to: Start an Instant Message Conversation.
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 2013 Preview.
-
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 2013 Preview on the calling computer. See the accept call request on the computer you called.