Cookie CSS

Saturday, March 7, 2015

Start a Lync/Skype for Business meeting from code

Today we are going to take a quick look at what it takes to perform the same function as clicking meet now in the Lync client menu, then adding your other participants.  Some operations in Lync can be painfully slow for low patience users like myself, so anything that can be automated faster and better always grabs my attention.  For this scenario there are 2 things we will need to code for.



1.  Start the meeting.

This is actually pretty simple, lets again assume we have the Lync libraries added to a VS c# project, and the following declaration.

using Microsoft.Lync.Model;
using Microsoft.Lync.Model.Conversation;
using Microsoft.Lync.Model.Conversation.Sharing;

Microsoft.Lync.Model.LyncClient _LyncClient;

                _LyncClient = LyncClient.GetClient();

Once everything is declared we make the following command.

 try
            {
                LyncClient.GetAutomation().BeginMeetNow(mymeet => 
                {
                    LyncClient.GetAutomation().EndMeetNow(mymeet);
                }, null);
            }
            catch { }

 Now we have started a new meeting.

2.  From here we can use Lync or code to add others too it, presuming you don't want to sit in a conference room alone.

Let's say our conversation is variable c.

c.AddParticipant("sip:joe@somecompany.com");

Thanks for tuning in.

Doug Routledge, C# Lync, Skype for Business, SQL, Exchange, UC Developer  BridgeOC



Bridge Operator Console - For Lync and Skype for Business

No comments:

Post a Comment

Any spam comments will be deleted and your user account will be disabled.