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!
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With