Prashanth
Prashanth

Reputation: 121

How to get client's contact details in lync sdk c#

Which Object has the client contact information like office,company,IM, etc,. in Lync SDK 2013? I want to know the user's(client's) location/address information.

Upvotes: 2

Views: 897

Answers (2)

Rafael
Rafael

Reputation: 742

In addition to Kannan's answer, getting the phone numbers from a contact is different and requires more work. Here's how you do it:

LyncClient lyncClient = LyncClient.GetClient();
Contact contact = lyncClient.ContactManager.GetContactByUri("sip:[email protected]");

List<object> endPoints = new List<object>();
var telephoneNumber = (List<object>)contact.GetContactInformation(ContactInformationType.ContactEndpoints);
endPoints = telephoneNumber.Where<object>(N => ((ContactEndpoint)N).Type == ContactEndpointType.HomePhone || ((ContactEndpoint)N).Type == ContactEndpointType.MobilePhone || ((ContactEndpoint)N).Type == ContactEndpointType.OtherPhone || ((ContactEndpoint)N).Type == ContactEndpointType.WorkPhone).ToList<object>();

foreach (var endPoint in endPoints)
{
    //((ContactEndpoint)endPoint).DisplayName.ToString(); //This is the phone number in string format
}

Upvotes: 0

Kannan T
Kannan T

Reputation: 46

User location/office information can be obtained from contact object as given below:

LyncClient lyncClient = LyncClient.GetClient();
Contact contact = lyncClient.ContactManager.GetContactByUri("sip:[email protected]");
String officeLocation = contact.GetContactInformation(ContactInformationType.Office).ToString();

More information can be obtained using Contact information types Personal Note, Company, Location, Department etc.

Upvotes: 2

Related Questions