The following example shows code examples to be executed on multiple computers. One of the computers is used to start a conference using automation and the other computers are used to join the conference started on the first computer.

Starting the Conference

The first computer starts the conference by calling into BeginStartConversation and obtaining a new instance of ConversationWindow by calling into EndStartConversation . The Conversation property returns the Conversation instance used in the following snippet.

  Copy imageCopy Code
// Create the major API automation object.
Automation _Automation = LyncClient.GetAutomation();


// Create a generic List object to contain a contact URI and be
sure a valid URI is added.
List<string> inviteeList = new List<string>();
inviteeList.Add("elise@contoso.com");
inviteeList.Add("sam@contoso.com");


// Create a generic Dictionary object to contain conversation
setting objects.
Dictionary<AutomationModalitySettings, object>
_ModalitySettings = new Dictionary<AutomationModalitySettings,
object>();
AutomationModalities _ChosenMode =
AutomationModalities.InstantMessage;

_ModalitySettings.Add(AutomationModalitySettings.FirstInstantMessage,
"Weekly project status meeting starts now");
_ModalitySettings.Add(AutomationModalitySettings.SendFirstInstantMessageImmediately,
true);

// Start the conversation.
IAsyncResult ar = _Automation.BeginStartConversation(
	_ChosenMode
	, invitees
	, _ModalitySettings
	, null
	, null);

//Block UI thread until conversation is started
ConversationWindow conferenceWindow =
_Automation.EndStartConversation(ar);
Conversation conferenceConversationObject =
conferenceWindow.Conversation;

//Send this Conference Uri string to a set of potential meeting
attendee users within an email message.
string ConferenceUri = "conf:" +
conferenceConversationObject.Properties[ConversationProperty.ConferencingUri]
+ "?" +
conferenceConversationObject.Properties[ConversationProperty.Id];

The conference Uri obtained in the preceding snippet must be passed to users on other computers to allow them to join the new conference. The transfer method is out of scope for this discussion but can include email.

Joining the Conference

Elise and Sam are invited to the conference explicitly because they were added to the invitee list when the conference was started. These two users receive conversation invitations through Lync. Other users who should attend the meeting must get the conference Uri and then join the conference using the Uri.

Once the conference Uri has been 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.

Important note Important

The UI thread of this sample is blocked until the user has joined the conference. The call into EndStartConversation immediately follows BeginStartConversation , but does not return until the conference is joined. If you do not want to block your UI thread while the joining operation is in progress, pass a callback method into BeginStartConversation and then call EndStartConversation inside of the passed callback method.

  Copy imageCopy Code
IAsyncResult ar =
LyncClient.GetAutomation().BeginStartConversation(
	this.ConferenceUriObtainedFromEmail_string
	, this.Handle.ToInt32()
	, null
	, null);

_Automation.EndStartConversation(ar);

See Also