Reputation: 121
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
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
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