Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lync - inconsistent behavior with ContactEndpoints

Tags:

c#

lync

I'm working on custom UI for company's directory based on Lync. Using Lync 2013 I execute this search:

Container.Instance.Lync.ContactManager.BeginSearch(SearchQuery,
            SearchProviders.GlobalAddressList,
            SearchFields.AllFields,
            SearchOptions.IncludeContactsWithoutSipOrTelUri,
            500,
            ContactsAndGroupsCallback, SearchQuery);

For each of matching contacts I try to access their endpoints to display phone number:

var cit = ContactInformationType.ContactEndpoints;
var endpoints = contact.GetContactInformation(cit) as List<object>;

Problem

If found contact is in the contact list of account I'm using to connect Lync, then I get access to full details (5 endpoints). However if he is not in contact list, I get access to only 1 endpoint.

Any ideas why is it happening like that? Is there a global privacy setting I need to turn off or something?

How can I get access to all endpoints at all times?

Thank you.

PS: I tried to load each contact in the result set individually and still get the same behavior.

like image 688
Maxim Avatar asked Oct 03 '22 02:10

Maxim


2 Answers

I encountered a similar problem when trying to write a program to obtain the status of all users on Lync SDK 2010. Chose all users and read it's status (online / offline etc.). But it's working out well with only those contacts that were in the list of client contacts. I do not know why, but the solutions are not found.A little later I use UCMA 4 (with Application endpoint), though the list received from AD and only able to get the current status.

Maybe it makes sense to use the search by AD? Find phone number by user sip? If so, try to use this filter for DirectorySearcher:

searcher.Filter = "(&(objectClass=user)(msRTCSIP-PrimaryUserAddress=*))"; //put sip instead of *

P.S. what sdk are you using?

like image 52
Tahiaji Avatar answered Oct 07 '22 20:10

Tahiaji


Answer from Microsoft Support:

The behavior you are seeing is due to presence subscription optimization to the Lync client so that the subscription is delayed until the necessary contact information is required by the Lync client. Photo is an example for this optimization. Another example is ContactEndpoints. Please take a look at Contact presence subscription changes section of the Migration doc for Lync 2013 page in MSDN docs. Specifically you must create and maintain your own ContactSubscription for the contacts that you need all the ContactEndpoints.

like image 27
Maxim Avatar answered Oct 07 '22 19:10

Maxim