【问题标题】:How to detect Type/Modality of Lync Conversation?如何检测 Lync 对话的类型/方式?
【发布时间】:2016-09-29 06:55:08
【问题描述】:

我需要检查对话是语音通话还是聊天。 检查需要在触发 ConversationManager_ConversationAdded 事件时进行。

        private void InitialisiereLyncClient()
        {
            //(Running Lync instance)
            m_LyncClient = LyncClient.GetClient();
            ConversationManager m_ConversationManager = m_LyncClient.ConversationManager;


            m_ConversationManager.ConversationAdded += M_ConversationManager_ConversationAdded;
            m_ConversationManager.ConversationRemoved += M_ConversationManager_ConversationRemoved; 
        }

这里我想检查一下它是什么类型的 Conversation 来处理未来的操作。

        //Eigenschaften der Conversation
        IDictionary<ConversationProperty, object> m_properties = e.Conversation.Properties;

        //Informationen der Person, die das Event ausgelöst hat
        Contact m_caller = e.Conversation.Properties[ConversationProperty.Inviter] as Contact;

问题: 如何区分对话是音频/视频通话还是聊天对话?

【问题讨论】:

    标签: c# lync lync-2013 skype-for-business


    【解决方案1】:

    我找到了一个可行的解决方案。

            bool hasAVModality = e.Conversation.Modalities.ContainsKey(ModalityTypes.AudioVideo);
            if (hasAVModality)
            {
                //State of AV modality
                var state = e.Conversation.Modalities[ModalityTypes.AudioVideo].State;
                //Notified = Incoming
                if (state == ModalityState.Notified)
                {
                    //Do Something with the call
                }
            }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-01
      • 2015-10-17
      • 1970-01-01
      • 1970-01-01
      • 2011-04-04
      • 1970-01-01
      相关资源
      最近更新 更多