Month: October 2012

Join Lync Conference Using Lync 2013 SDK


This article explains how to prepare for and join online meetings using Microsoft Lync 2013 SDK, you can join a scheduled online meeting with colleagues and clients from down the hall or across the world without leaving your desk.

For online meetings with audio or video calls You can access your scheduled conference invite using Microsoft Lync 2013 SDK.

When a user schedules an Online meeting in Outlook 2007/2010 the meeting and Lync information associated with that meeting are stored in a number of MAPI properties on the Appointment Item.

You can use these information further to do many tasks i.e. to join a conference meeting, also you could use these information to put it in a calendar.

The following demonstrations run on different computers. These computers is used to start a conference by using Microsoft Lync 2013 SDK UI Automation mode or Microsoft Lync 2013 SDK UI Suppression mode.

Getting the Online Meeting URL

You could get the online meeting URLs by the Managed EWS API, Microsoft encourage Microsoft .NET Framework developers to use the EWS Managed API instead of auto-generated proxies to develop against Exchange Web Services. The EWS Managed API object model is significantly easier to use than auto-generated proxy object models.

You get more information how to use EWS in the previous post Get Lync Online Meetingsā€™ Information using the EWS ManagedĀ API

Getting the Conference URI

The conversation properties that you use to form a complete conference URI are null at the time that the conversation is created.

To get the conference URI properties, you register for the Conversation.PropertyChanged event on the conversation to get the URI value

The following are examples of how to build a conference join URL using properties of the conversation.

UI Automation Mode

private void Conversation_PropertyChanged
    (object sender, ConversationPropertyChangedEventArgs e)
{
    //Getting meeting url
    if (e.Property == ConversationProperty.ConferencingUri)
    { 
        string ConferenceUri = "conf:" 
           + ((Conversation)sender).Properties[ConversationProperty.ConferencingUri]
           + "?" + ((Conversation)sender).Properties[ConversationProperty.Id];
    }
}

UI Suppression Mode

void ConversationManager_ConversationAdded
    (object sender, ConversationManagerEventArgs e)
{
    //Getting meeting url
    string url = string.Empty;
    string domain = string.Empty;
    string name = string.Empty;
    string id = string.Empty;

    url = ConferenceUrl.Replace("https://meet.","");
    url = url.Substring(0, url.Length);
    domain = url.Substring(0, url.IndexOf("/"));
    url = url.Replace(domain + "/", "");
    name = url.Substring(0, url.IndexOf("/"));
    id = url.Replace(name + "/", "");
    url = "conf:sip:" + name + "@" + domain + 
          ";gruu;opaque=app:conf:focus:id:" + id + "?" +
          _activeConversation.Properties[ConversationProperty.Id].ToString();
}

Joining the Conference

Once the conference URI is obtained by another user, use the BeginStartConversation method to join a conference in a Microsoft Lync 2010 SDK application. The string argument of the call is the conference URI.

UI Automation Mode

IAsyncResult ar = LyncClient.GetAutomation().BeginStartConversation(
    this.ConferenceUriObtainedFromEmail_string,
    this.Handle.ToInt32(),
    null,
    null);
_Automation.EndStartConversation(ar);

UI Suppression Mode

void ConversationManager_ConversationAdded
    (object sender, ConversationManagerEventArgs e)
{
    //Join the conference
    _activeConversation.ConversationManager.JoinConference(url);
}