Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use the Microsoft Lync API to communicate with Communicator 2007/2007 R2?

I'm coding IM Presence information into one of my companies silverlight applications. So far, the only solution I've found is one on CodePlex (Silverlight.OCS). It's "okay", but it's extremely dated.

The Lync SDK makes it obnoxiously easy to get Presence information inside silverlight. Unfortunately, 99% of the users on our network are still on OFfice Communicator (R2), so using the out-of-the-box Lync method (controls:PresenceIndicator... in xaml) cannot work.

So, I'm curious if the Lync SDK contains a way to communicate with Office Communicator?

If so, how would I a) check what client is running and then b) connect to that client - be it Lync or Communicator. Any help is very much appreciated! Last but not least - I'm looking for C# code if at all possible. Thanks!

like image 732
Chianti Avatar asked May 19 '12 05:05

Chianti


People also ask

What is Microsoft Lync used for?

Microsoft Lync is an instant-messaging client used with Skype for Business Server or with Skype for Business Online (available with Microsoft Office 365). They replace Windows Messenger, which ran with Microsoft Exchange Server.

What replaced Microsoft Lync?

Skype for Business (formerly Microsoft Lync and Office Communicator) is an enterprise software application for instant messaging and videotelephony developed by Microsoft as part of the Microsoft Office suite.

How do I access Lync?

After you install Lync from the Microsoft Microsoft 365 portal and sign in to it for the first time, you'll be automatically signed in to Lync the next time you log in on that computer. Important: You sign in to Lync by using yourwork or school account.


1 Answers

You can't use the Lync 2010 SDK against Office Communicator, only Lync 2010.

The previous incarnation of the SDK is the Office Communicator Automation API (OCAA). It's a COM-based API, and will work against Communication 2007 and 2007 R2. It's still supported...for now!

You can download the API here. The MSDN landing page is here.

As for getting presence information...well, hopefully this might help you (with a disclaimer that I'm too young to have done any OCS API work ;)

Getting a contact record:

    private IMessengerContact FindContact(string userID)
{
    IMessengerContact contact = null;
    // Try the local contact list first
    try
    {
        contact = (IMessengerContact)communicator.GetContact(userID, "");
    }
    catch
    {
        contact = null;
    }

    // For a nonlocal contact, try the SIP Provider of Communicator
    if (contact == null || contact.Status == MISTATUS.MISTATUS_UNKNOWN)
    {
        try
        {
            contact =
                (IMessengerContact)communicator.GetContact(userID,
                communicator.MyServiceId);
            return contact;
        }
        catch
        {
            contact = null;
            return contact;
        }
    }
    else
    {
        return contact;
    }
}

Returning the status of a contact:

The IMessengerContact interface defines a property Status, which contains one of a number of MISTATUS values.

like image 146
Tom Morgan Avatar answered Oct 17 '22 02:10

Tom Morgan