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.
Asked
Active
Viewed 869 times
2 Answers
2
User location/office information can be obtained from contact object as given below:
LyncClient lyncClient = LyncClient.GetClient();
Contact contact = lyncClient.ContactManager.GetContactByUri("sip:contact@organization.com");
String officeLocation = contact.GetContactInformation(ContactInformationType.Office).ToString();
More information can be obtained using Contact information types Personal Note, Company, Location, Department etc.

Kannan T
- 46
- 3
0
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:contact@organization.com");
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
}

Rafael
- 727
- 13
- 30