botframeworklyncskype-for-businesslync-2013lync-client-sdk

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.


Solution

  • 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
    }