2

Lync SDK を使用して連絡先情報と電話番号を取得し、アプリケーションに表示します。Lync 検索コントロールが使用され、連絡先を右クリックすると、連絡先の電話番号を取得しようとします。

これにより、Lync 検索コントロールの連絡先カードに完全な情報が返されないという断続的な問題が発生します。うまく機能することもありますが、完全な電話番号リストを返すことができないこともあります。

List<object> endPoints = new List<object>();
List<ContactInformationType> _ContactInformationList = new List<ContactInformationType>();
_ContactInformationList.Add(ContactInformationType.EmailAddresses);
_ContactInformationList.Add(ContactInformationType.ContactEndpoints);
try
{
    if (!string.IsNullOrWhiteSpace(sipuri))
    {
        Contact _contact = lyncObj.ContactManager.GetContactByUri(sipuri);
        Microsoft.Lync.Controls.ContactCard _contactCard = new Microsoft.Lync.Controls.ContactCard();
        _contactCard.Source = contact.GetContactInformation(ContactInformationType.EmailAddresses);
        ContactSubscription _contactSubscription = lyncObj.ContactManager.CreateSubscription();
        _contactSubscription.AddContact(_contact);
        _contactSubscription.Subscribe(ContactSubscriptionRefreshRate.High, _ContactInformationList);
        // add sleep to subscribe 
        System.Threading.Thread.Sleep(500);
        var telephoneNumbersList = (List<object>)_contact.GetContactInformation(ContactInformationType.ContactEndpoints);
        foreach (object endPoint in telephoneNumbersList)
        {
            Logger.LogInfo(((ContactEndpoint)endPoint).DisplayName + " " + ((ContactEndpoint)endPoint).Type.ToString());
        }
        endPoints = telephoneNumbersList.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>();
    }
}

完全な連絡先情報が返されないことが何度かあります。連絡先情報には、2 つの電話番号のうち 1 つのみが表示されます。しばらくの間、すべての電話番号が返されます。

Microsoft Lync 検索で同じ連絡先を検索しようとすると、連絡先カードにすべての電話番号が表示されます。

根本的な原因と考えられる解決策を教えてください。

4

1 に答える 1