Пример #1
0
        /// <summary>
        /// 关闭音视频
        /// </summary>
        public static void Close_AV(ConversationWindow conversationWindow)
        {
            try
            {
                AVModality avModality = (AVModality)conversationWindow.Conversation.SelfParticipant.Modalities[ModalityTypes.AudioVideo];
                if (avModality != null)
                {
                    AudioChannel audioChannel = avModality.AudioChannel;
                    if (audioChannel != null && audioChannel.CanInvoke(ChannelAction.Stop))
                    {
                        audioChannel.BeginStop(null, null);
                    }

                    VideoChannel videoChannel = avModality.VideoChannel;

                    if (videoChannel != null && videoChannel.CanInvoke(ChannelAction.Stop))
                    {
                        videoChannel.BeginStop(null, null);
                    }
                }
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(typeof(LyncHelper), ex);
            }
            finally
            {
            }
        }
Пример #2
0
        private static void StartOurVideo(AVModality avModality)
        {
            var channelStream = avModality.VideoChannel;

            while (!channelStream.CanInvoke(ChannelAction.Start))
            {
            }

            channelStream.BeginStart(ar => { }, channelStream);
            var count = 0;

            while ((channelStream.State != ChannelState.SendReceive) && (count < 5))
            {
                Thread.Sleep(1000);

                try
                {
                    channelStream.BeginStart(ar => { }, channelStream);
                }
                catch (NotSupportedException)
                {
                    //This is normal...
                }
                count++;
            }
        }
Пример #3
0
        internal override void HandleAddedInternal()
        {
            //saves the AVModality, AudioChannel and VideoChannel, just for the sake of readability
            _avModality   = (AVModality)Conversation.Modalities[ModalityTypes.AudioVideo];
            _audioChannel = _avModality.AudioChannel;
            _videoChannel = _avModality.VideoChannel;

            //subscribes to modality action availability events (all audio button except DTMF)
            _avModality.ActionAvailabilityChanged += OnAvModalityActionAvailabilityChanged;

            //subscribes to the modality state changes so that the status bar gets updated with the new state
            _avModality.ModalityStateChanged += OnAvModalityModalityStateChanged;


            //subscribes to the audio channel action availability events (DTMF only)
            _audioChannel.ActionAvailabilityChanged += OnAudioChannelActionAvailabilityChanged;

            //subscribes to the video channel state changes so that the status bar gets updated with the new state
            _audioChannel.StateChanged += OnAudioChannelStateChanged;


            //subscribes to the video channel action availability events
            _videoChannel.ActionAvailabilityChanged += OnVideoChannelActionAvailabilityChanged;

            //subscribes to the video channel state changes so that the video feed can be presented
            _videoChannel.StateChanged += OnVideoChannelStateChanged;

            //foreach (var item in Conversation.Participants)
            //{
            //	InitParticipant(item);
            //}
        }
Пример #4
0
        /// <summary>
        /// Prevents a default instance of the <see cref="CallHandler"/> class from being created.
        /// </summary>
        private CallHandler()
        {
            this.lyncClient = LyncClient.GetClient();

            // FOR CWE WINDOW,use current hosting conversation
            this.conversation = (Conversation)Microsoft.Lync.Model.LyncClient.GetHostingConversation();
            if (this.conversation == null)
            {
                this.conversation = this.lyncClient.ConversationManager.Conversations[this.lyncClient.ConversationManager.Conversations.Count - 1];
            }

            this.audioVideoModality = (AVModality)this.conversation.Modalities[ModalityTypes.AudioVideo];
            this.audioChannel       = this.audioVideoModality.AudioChannel;

            this.conversation.StateChanged += this.Conversation_StateChangedEvent;
            this.conversation.BeginSendContextData("{553C1CE2-0C73-51B6-81C7-75F2D071FCD2}", @"plain/text", "hi", SendContextDataCallBack, null);

            this.audioVideoModality.ModalityStateChanged += new EventHandler <ModalityStateChangedEventArgs>(this.AudioVideoModality_ModalityStateChanged);

            this.instantMessageModality = (InstantMessageModality)this.conversation.Modalities[ModalityTypes.InstantMessage];

            this.remoteModality = this.conversation.Participants[1].Modalities[ModalityTypes.InstantMessage] as InstantMessageModality;

            this.remoteModality.InstantMessageReceived += new EventHandler <MessageSentEventArgs>(this.RemoteModality_InstantMessageReceived);

            this.instantMessageModality.InstantMessageReceived += new EventHandler <MessageSentEventArgs>(this.ImModality_InstantMessageReceived);

            this.CurrentMenuLevel = 0;
        }
Пример #5
0
        internal override void ConversationParticipantRemovedInternal(ParticipantItem participant)
        {
            //get the application sharing modality of the removed participant out of the class modalty dicitonary
            AVModality removedModality = participant.AVModality;

            //Un-register for modality events on this participant's application sharing modality.
            removedModality.ActionAvailabilityChanged -= OnParticipantActionAvailabilityChanged;
            removedModality.ModalityStateChanged      -= OnParticipantModalityStateChanged;
        }
Пример #6
0
        /// <summary>
        /// Initiates the window for the specified conversation.
        /// </summary>
        public ConversationWindow(Conversation conversation, LyncClient client)
        {
            InitializeComponent();

            //saves the client reference
            this.client = client;

            //saves the conversation reference
            this.conversation = conversation;

            //saves the AVModality, AudioChannel and VideoChannel, just for the sake of readability
            avModality   = (AVModality)conversation.Modalities[ModalityTypes.AudioVideo];
            audioChannel = avModality.AudioChannel;
            videoChannel = avModality.VideoChannel;

            //show the current conversation and modality states in the UI
            toolStripStatusLabelConvesation.Text = conversation.State.ToString();
            toolStripStatusLabelModality.Text    = avModality.State.ToString();

            //enables and disables the checkbox associated with the ConversationProperty.AutoTerminateOnIdle property
            //based on whether the Lync client is running in InSuppressedMode
            //se more details in the checkBoxAutoTerminateOnIdle_CheckStateChanged() method
            checkBoxAutoTerminateOnIdle.Enabled = client.InSuppressedMode;

            //registers for conversation state updates
            conversation.StateChanged += conversation_StateChanged;

            //registers for participant events
            conversation.ParticipantAdded   += conversation_ParticipantAdded;
            conversation.ParticipantRemoved += conversation_ParticipantRemoved;

            //subscribes to the conversation action availability events (for the ability to add/remove participants)
            conversation.ActionAvailabilityChanged += conversation_ActionAvailabilityChanged;

            //subscribes to modality action availability events (all audio button except DTMF)
            avModality.ActionAvailabilityChanged += avModality_ActionAvailabilityChanged;

            //subscribes to the modality state changes so that the status bar gets updated with the new state
            avModality.ModalityStateChanged += avModality_ModalityStateChanged;

            //subscribes to the audio channel action availability events (DTMF only)
            audioChannel.ActionAvailabilityChanged += audioChannel_ActionAvailabilityChanged;

            //subscribes to the video channel state changes so that the status bar gets updated with the new state
            audioChannel.StateChanged += audioChannel_StateChanged;

            //subscribes to the video channel action availability events
            videoChannel.ActionAvailabilityChanged += videoChannel_ActionAvailabilityChanged;

            //subscribes to the video channel state changes so that the video feed can be presented
            videoChannel.StateChanged += videoChannel_StateChanged;
        }
Пример #7
0
        public void Init()
        {
            _lyncClient = LyncClient.GetClient();

            //
            foreach (var conversation in _lyncClient.ConversationManager.Conversations)
            {
                _avModality = (AVModality)conversation.Modalities[ModalityTypes.AudioVideo];
                _avModality.ModalityStateChanged += AvModality_ModalityStateChanged;
            }

            _lyncClient.ConversationManager.ConversationAdded   += ConversationManager_ConversationAdded;
            _lyncClient.ConversationManager.ConversationRemoved += ConversationManager_ConversationRemoved;
        }
Пример #8
0
        /// <summary>
        /// 启动视频
        /// </summary>
        /// <param name="conversationWindow"></param>
        public static void StartVideo(ConversationWindow conversationWindow)
        {
            try
            {
                ThreadPool.QueueUserWorkItem((o) =>
                {
                    AVModality avModality = (AVModality)conversationWindow.Conversation.SelfParticipant.Modalities[ModalityTypes.AudioVideo];
                    if (avModality != null)
                    {
                        VideoChannel videoChannel = avModality.VideoChannel;

                        //object obV = videoChannel.InnerObject;
                        if (videoChannel != null)
                        {
                            if (videoChannel != null && videoChannel.CanInvoke(ChannelAction.Start))
                            {
                                videoChannel.BeginStart(null, null);
                            }

                            TimerJob.StartRun(new Action(() =>
                            {
                                if (videoChannel.State != ChannelState.Connecting)
                                {
                                    if (videoChannel != null && videoChannel.CanInvoke(ChannelAction.Start))
                                    {
                                        videoChannel.BeginStart(null, null);
                                    }
                                }
                            }), 1500);
                            LyncHelper.ExitFullScreen();
                            LyncHelper.FullScreen();
                        }
                    }
                });
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(typeof(LyncHelper), ex);
            }
            finally
            {
            }
        }
Пример #9
0
        public static void StartVideo(AVModality av)
        {
            ExecuteAction.InState(av, ModalityState.Connected, modality =>
            {
                var video = modality.VideoChannel;

                Predicate <Channel> active = channel =>
                                             channel.State == ChannelState.Connecting ||
                                             channel.State == ChannelState.Send ||
                                             channel.State == ChannelState.SendReceive;

                if (!active(video))
                {
                    while (!video.CanInvoke(ChannelAction.Start))
                    {
                    }
                    StartMediaChannel(video);
                }
            });
        }
Пример #10
0
 public static void AvConnect(ConversationWindow conversationWindow)
 {
     try
     {
         AVModality avModality = (AVModality)conversationWindow.Conversation.Modalities[ModalityTypes.AudioVideo];
         if (avModality != null)
         {
             if (avModality.CanInvoke(ModalityAction.Connect))
             {
                 avModality.BeginConnect(null, null);
             }
         }
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(typeof(LyncHelper), ex);
     }
     finally
     {
     }
 }
        private void InitializeConversation()
        {
            //saves the AVModality, AudioChannel and VideoChannel, just for the sake of readability
            avModality = (AVModality)conversation.Modalities[ModalityTypes.AudioVideo];
            audioChannel = avModality.AudioChannel;
            videoChannel = avModality.VideoChannel;

            // TODO: fix the UI

            //show the current conversation and modality states in the UI
            this.SetConversationStatus(conversation.State.ToString());
            this.SetModalityStatus(avModality.State.ToString());
            this.SetAudioStatus("Disconnected");
            this.SetVideoStatus("Disconnected");

            //registers for conversation state updates
            conversation.StateChanged += this.ConversationStateChanged;
            //subscribes to modality action availability events (all audio button except DTMF)
            avModality.ActionAvailabilityChanged += this.AvModalityActionAvailabilityChanged;
            //subscribes to the modality state changes so that the status bar gets updated with the new state
            avModality.ModalityStateChanged += this.AvModalityModalityStateChanged;
            //subscribes to the video channel state changes so that the status bar gets updated with the new state
            audioChannel.StateChanged += this.AudioChannelStateChanged;
            //subscribes to the video channel state changes so that the video feed can be presented
            videoChannel.StateChanged += this.VideoChannelStateChanged;
        }
Пример #12
0
 private void ConversationManager_ConversationAdded(object sender, ConversationManagerEventArgs e)
 {
     _avModality = (AVModality)e.Conversation.Modalities[ModalityTypes.AudioVideo];
     _avModality.ModalityStateChanged += AvModality_ModalityStateChanged;
     _currentConversation              = e.Conversation;
 }
Пример #13
0
 private void ConversationManager_ConversationRemoved(object sender, ConversationManagerEventArgs e)
 {
     _avModality = (AVModality)e.Conversation.Modalities[ModalityTypes.AudioVideo];
     _avModality.ModalityStateChanged -= AvModality_ModalityStateChanged;
 }
Пример #14
0
        public static void StopVideo(AVModality av)
        {
            var video = av.VideoChannel;

            StopMediaChannel(video);
        }
        /// <summary>
        /// 设置会话窗体
        /// </summary>
        protected static void SettingConversationWindowEvent(ConversationWindow conversationWindow)
        {
            try
            {
                if (conversationWindow != null)
                {
                    if (conversationWindow.Conversation != null)
                    {
                        Conversation conversation = conversationWindow.Conversation;
                        IDictionary <ModalityTypes, Modality> dicModality = conversation.Modalities;
                        //会话模型
                        ContentSharingModality contentSharingModality = ((ContentSharingModality)dicModality[ModalityTypes.ContentSharing]);
                        Modality ContentModal = (dicModality[ModalityTypes.ContentSharing]);
                        ApplicationSharingModality applicationSharingModality = ((ApplicationSharingModality)(dicModality[ModalityTypes.ApplicationSharing]));
                        Modality   ApplicationModal = (dicModality[ModalityTypes.ApplicationSharing]);
                        AVModality AudioVideoModal  = ((AVModality)dicModality[ModalityTypes.AudioVideo]);

                        //联系人添加事件
                        conversation.ParticipantAdded -= Conversation_ParticipantAdded;
                        //联系人添加事件
                        conversation.ParticipantAdded += Conversation_ParticipantAdded;
                        //联系人移除事件
                        conversation.ParticipantRemoved -= Conversation_ParticipantRemoved;
                        //联系人移除事件
                        conversation.ParticipantRemoved += Conversation_ParticipantRemoved;

                        if (contentSharingModality != null)
                        {
                            //电子白板、ppt共享内容添加事件
                            contentSharingModality.ContentAdded -= ConversationCard_ContentAdded;
                            //电子白板、ppt共享内容添加事件
                            contentSharingModality.ContentAdded += ConversationCard_ContentAdded;

                            //电子白板、ppt共享内容移除事件
                            contentSharingModality.ContentRemoved -= ConversationCard_ContentRemoved;
                            //电子白板、ppt共享内容移除事件
                            contentSharingModality.ContentRemoved += ConversationCard_ContentRemoved;
                        }
                        if (ContentModal != null)
                        {
                            //电子白板、ppt共享
                            ContentModal.ActionAvailabilityChanged -= ConversationCard_ActionAvailabilityChanged;
                            //电子白板、ppt共享
                            ContentModal.ActionAvailabilityChanged += ConversationCard_ActionAvailabilityChanged;
                        }
                        if (ApplicationModal != null)
                        {
                            //应用程序共享
                            ApplicationModal.ActionAvailabilityChanged -= ConversationCard_ActionAvailabilityChanged;
                            //应用程序共享
                            ApplicationModal.ActionAvailabilityChanged += ConversationCard_ActionAvailabilityChanged;

                            if (applicationSharingModality != null)
                            {
                                applicationSharingModality.LocalSharedResourcesChanged -= applicationSharingModality_LocalSharedResourcesChanged;
                                applicationSharingModality.LocalSharedResourcesChanged += applicationSharingModality_LocalSharedResourcesChanged;
                                applicationSharingModality.ControllerChanged           -= applicationSharingModality_ControllerChanged;
                                applicationSharingModality.ControllerChanged           += applicationSharingModality_ControllerChanged;

                                applicationSharingModality.ParticipationStateChanged -= applicationSharingModality_ParticipationStateChanged;
                                applicationSharingModality.ParticipationStateChanged += applicationSharingModality_ParticipationStateChanged;
                            }
                        }
                        //音视频
                        AudioVideoModal.ActionAvailabilityChanged -= ConversationCard_ActionAvailabilityChanged;
                        //音视频
                        AudioVideoModal.ActionAvailabilityChanged += ConversationCard_ActionAvailabilityChanged;


                        //实时获取会话窗体信息
                        conversationWindow.InformationChanged -= ConversationWindow_InformationChanged;
                        //实时获取会话窗体信息
                        conversationWindow.InformationChanged += ConversationWindow_InformationChanged;
                    }
                }
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(typeof(LyncHelper), ex);
            }
        }
        /// <summary>
        /// 会话加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public static void ConversationManager_ConversationAdded(object sender, Microsoft.Lync.Model.Conversation.ConversationManagerEventArgs e)
        {
            //查看是否已进入一个会议【倘若未进入会议,则直接进行拒绝,该逻辑有待斟酌】
            bool canOpenTheConversation = true;

            if (HasConferenceCallBack != null)
            {
                HasConferenceCallBack(new Action <bool>((hasConference) =>
                {
                    //if (hasConference)
                    //{
                    //    canOpenTheConversation = false;
                    //}
                }));
            }


            //子线程不可直接调用主线程的UI(需要通过异步委托的机制去执行)
            Application.Current.Dispatcher.BeginInvoke(new Action(() =>
            {
                try
                {
                    #region 响应会话

                    //获取发起人的会话模式
                    IDictionary <ModalityTypes, Modality> modalities = e.Conversation.Modalities;

                    //通知模式
                    //NotifyType notifyType = NotifyType.InstantMessage;

                    AVModality avModality = (AVModality)modalities[ModalityTypes.AudioVideo];

                    //视频通道
                    VideoChannel videoChannel = ((AVModality)modalities[ModalityTypes.AudioVideo]).VideoChannel;

                    //音频通道
                    AudioChannel audioChannel = ((AVModality)modalities[ModalityTypes.AudioVideo]).AudioChannel;
                    //IM类型
                    var instantMessage = modalities[ModalityTypes.InstantMessage];
                    //查看当前视频会话具体应用
                    if (videoChannel.State == ChannelState.Notified)
                    {
                        if (canOpenTheConversation)
                        {
                            ((AVModality)modalities[ModalityTypes.AudioVideo]).Accept();
                            //notifyType = NotifyType.Video;

                            TimerJob.StartRun(new Action(() =>
                            {
                                //判断是否可以执行该操作
                                if (videoChannel.CanInvoke(ChannelAction.Start))
                                {
                                    ////接受请求,开启摄像头
                                    videoChannel.BeginStart(null, null);
                                    //停止计时器
                                    timerAcept.Stop();
                                }
                            }), 500, out timerAcept);
                        }
                        else
                        {
                            //拒绝音频会话
                            ((AVModality)modalities[ModalityTypes.AudioVideo]).Reject(ModalityDisconnectReason.NotAcceptableHere);
                            return;
                        }
                    }
                    //查看当前音频会话具体应用
                    else if (audioChannel.State == ChannelState.Notified)
                    {
                        if (canOpenTheConversation)
                        {
                            //接受音频会话
                            ((AVModality)modalities[ModalityTypes.AudioVideo]).Accept();
                            //notifyType = NotifyType.Autio;
                        }
                        else
                        {
                            //拒绝音频会话
                            ((AVModality)modalities[ModalityTypes.AudioVideo]).Reject(ModalityDisconnectReason.NotAcceptableHere);
                        }
                    }
                    //IMM文本会话,查看是否为通知状态(避免与语音、视频通话相互之间发生冲突)
                    if (instantMessage.State == ModalityState.Notified || instantMessage.State == ModalityState.Connected)
                    {
                        if (canOpenTheConversation)
                        {
                            ((InstantMessageModality)modalities[ModalityTypes.InstantMessage]).Accept();

                            #region old solution

                            //if (e.Conversation.Participants.Count <= 2)
                            //{
                            //    //模仿鼠标点击
                            //    Win32API.SetCursorPos(System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - 100, System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - 160);
                            //    Win32API.mouse_event(Win32API.MouseEventFlag.LeftDown, 0, 0, 0, UIntPtr.Zero);
                            //    Win32API.mouse_event(Win32API.MouseEventFlag.LeftUp, 0, 0, 0, UIntPtr.Zero);
                            //}

                            #endregion
                        }
                        else
                        {
                            ((InstantMessageModality)modalities[ModalityTypes.InstantMessage]).Reject(ModalityDisconnectReason.NotAcceptableHere);
                        }
                    }

                    #endregion

                    #region 设置窗体位置和尺寸

                    //获取会话窗体
                    ConversationWindow window = null;

                    //获取会话窗体
                    window = ConversationCodeEnterEntity.lyncAutomation.GetConversationWindow(e.Conversation);
                    window.NeedsSizeChange -= window_NeedsSizeChange;
                    window.NeedsSizeChange += window_NeedsSizeChange;
                    if (MainConversationOutCallBack != null)
                    {
                        MainConversationOutCallBack(window);
                    }

                    //设置会话窗体的事件
                    SettingConversationWindowEvent(window);

                    #endregion

                    #region 共享设置

                    window.StateChanged -= MainConversation_StateChanged;
                    //状态更改
                    window.StateChanged += MainConversation_StateChanged;

                    //为共享做准备
                    TimerJob.StartRun(new Action(() =>
                    {
                        //连接共享
                        var modaly = ((ContentSharingModality)e.Conversation.SelfParticipant.Conversation.Modalities[ModalityTypes.ContentSharing]);

                        if (modaly.CanInvoke(ModalityAction.Accept))
                        {
                            modaly.Accept();
                        }

                        if (modaly.CanInvoke(ModalityAction.Connect))
                        {
                            modaly.BeginConnect(null, null);
                        }
                    }));

                    #endregion

                    #region 会话加载完成事件激活

                    if (ConversationAddCompleateCallBack != null)
                    {
                        ConversationAddCompleateCallBack();
                    }

                    #endregion
                }
                catch (Exception ex)
                {
                    LogManage.WriteLog(typeof(LyncHelper), ex);
                }
            }));
        }
        private static void Modality_Response_Connect(ConversationWindow conversationWindow)
        {
            try
            {
                var modalities = conversationWindow.Conversation.Modalities;

                //视频通道
                VideoChannel videoChannel = null;

                //音频通道
                AudioChannel audioChannel = null;

                AVModality avModality = ((AVModality)modalities[ModalityTypes.AudioVideo]);
                if (avModality != null)
                {
                    //视频通道
                    videoChannel = avModality.VideoChannel;
                    //音频通道
                    audioChannel = avModality.AudioChannel;
                }

                //视频
                if (videoChannel != null && videoChannel.State == ChannelState.Connecting)
                {
                    Application.Current.Dispatcher.BeginInvoke(new Action(() =>
                    {
                        try
                        {
                            if (avModality.CanInvoke(ModalityAction.Accept))
                            {
                                //接受
                                avModality.Accept();

                                if (videoChannel.CanInvoke(ChannelAction.Start))
                                {
                                    videoChannel.BeginStart(null, null);
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            LogManage.WriteLog(typeof(LyncHelper), ex);
                        };
                    }));
                }
                //语音
                else if (audioChannel != null && audioChannel.State == ChannelState.Connecting)
                {
                    if (avModality.CanInvoke(ModalityAction.Accept))
                    {
                        //接受
                        avModality.Accept();
                    }
                }
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(typeof(LyncHelper), ex);
            }
            finally
            {
            }
        }
        /// <summary>
        /// 通道响应(accept)
        /// </summary>
        /// <param name="conversationWindow">会话窗体</param>
        private static void Modality_Response_Accept(ConversationWindow conversationWindow)
        {
            try
            {
                var modalities = conversationWindow.Conversation.Modalities;

                //视频通道
                VideoChannel videoChannel = null;

                //音频通道
                AudioChannel audioChannel = null;

                AVModality avModality = ((AVModality)modalities[ModalityTypes.AudioVideo]);
                if (avModality != null)
                {
                    //视频通道
                    videoChannel = avModality.VideoChannel;
                    //音频通道
                    audioChannel = avModality.AudioChannel;
                }

                //内容共享
                ContentSharingModality shareContent = (ContentSharingModality)modalities[ModalityTypes.ContentSharing];
                //程序共享
                ApplicationSharingModality applicationSharing = (ApplicationSharingModality)modalities[ModalityTypes.ApplicationSharing];


                //视频
                if (videoChannel != null && videoChannel.State == ChannelState.Receive)
                {
                    Application.Current.Dispatcher.BeginInvoke(new Action(() =>
                    {
                        try
                        {
                            if (avModality.CanInvoke(ModalityAction.Accept))
                            {
                                //接受
                                avModality.Accept();

                                if (videoChannel.CanInvoke(ChannelAction.Start))
                                {
                                    videoChannel.BeginStart(null, null);
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            LogManage.WriteLog(typeof(LyncHelper), ex);
                        };
                    }));
                }
                //语音
                else if (audioChannel != null && audioChannel.State == ChannelState.Receive)
                {
                    if (avModality.CanInvoke(ModalityAction.Accept))
                    {
                        //接受
                        avModality.Accept();
                    }
                }
                //共享ppt、电子白板
                else if (shareContent != null && shareContent.State == ModalityState.Notified)
                {
                    shareContent.Accept();
                }
                //共享应用程序
                else if (applicationSharing != null && applicationSharing.State == ModalityState.Notified)
                {
                    applicationSharing.Accept();
                    if (AddContent_Type_CallBack != null)
                    {
                        AddContent_Type_CallBack(SharingType.Application);
                    }
                }
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(typeof(LyncHelper), ex);
            }
            finally
            {
            }
        }