联系人端点 phone,Lync 2013

ContactEndpoint phone, Lync 2013

我的应用程序使用 Lync 2013,通过 websocket 与服务器通信,并接收通知。 这些通知采用 Json 格式,因此我将其转换为提取字符串。 该字符串是一个 phone 号码,我想测试我的某个联系人是否是相同的 phone 号码以显示他的姓名。

我的 If 总是 "false"。 我想使用 > 并提取 DisplayName 的值(phone 数字作为字符串),但我不知道该怎么做。 这是我的代码。

foreach (var group in client.ContactManager.Groups)
                {
                    foreach (Contact contact in group)
                    {

                        List<object> endpoints = (List<object>)contact.GetContactInformation(ContactInformationType.ContactEndpoints);
                        List<object> phoneNumbers = endpoints.Cast<object>().Where<object>(N => ((ContactEndpoint)N).Type == ContactEndpointType.HomePhone ||
                                                               ((ContactEndpoint)N).Type == ContactEndpointType.MobilePhone ||
                                                               ((ContactEndpoint)N).Type == ContactEndpointType.WorkPhone ||
                                                               ((ContactEndpoint)N).Type == ContactEndpointType.OtherPhone).ToList();

                        if (phoneNumbers.ToList().Contains(call.caller))
                        {
                            MessageBox.Show(contact.GetContactInformation(ContactInformationType.DisplayName).ToString());
                        }
                    }
                }

您可以直接通过格式为电话 URL 的 number 向联系人管理员索取联系人。例如"el:12345678"

例如

var contact = client.ContactManager.GetContactByUri("tel:" + call.caller);