代码之家  ›  专栏  ›  技术社区  ›  J-Go

ContactEndpoint电话,Lync 2013

  •  0
  • J-Go  · 技术社区  · 7 年前

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

    我的If总是“false”。 我想使用>然后提取DisplayName的值(电话号码作为字符串),但我不知道怎么做。 这是我的密码。

    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());
                            }
                        }
                    }
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   Shane Powell    7 年前

    您可以通过直接向联系人经理咨询联系人 number 格式为电话URL。e、 g.“el:12345678”

    例如

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