wei
2021-08-27 eda3fb873e59544ff36301b51e05aef64f87b0f9
HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs
@@ -192,12 +192,18 @@
        /// 请求服务器获取当前住宅Sip账号信息并初始化LinphoneSDK和登录
        /// </summary>
        /// <param name="homeId"></param>
        public void GetHDLSipInfoAndInitSDK(string homeId)
        public void GetHDLSipInfoAndInitSDK(string homeId, bool clearCallInfo = true)
        {
            try
            {
                //先清空呼叫和监视设备信息
                InitCallInfo(null);
                if (clearCallInfo)
                {
                    InitCallInfo(null);
                }
                HDLSipInfo mHDLSipInfo = GetHDLSipInfo(homeId);
                if (mHDLSipInfo != null)
                {
@@ -223,7 +229,7 @@
        /// </summary>
        /// <param name="mHDLCallVideoInfo"></param>
        /// <param name="mInterphoneType"></param>
        public void InitCallInfo(HDLCallVideoInfo mHDLCallVideoInfo)
        void InitCallInfo(HDLCallVideoInfo mHDLCallVideoInfo)
        {
            this.mHDLCallVideoInfo = mHDLCallVideoInfo;
        }
@@ -437,7 +443,7 @@
                Utlis.WriteLine("CALL 收到推送 其他住宅,重新获取呼叫住宅的SIP账号并登录");
                new Thread(() =>
                {
                    GetHDLSipInfoAndInitSDK(mESVideoInfo.HomeId);
                    GetHDLSipInfoAndInitSDK(mESVideoInfo.HomeId, false);
                })
                { IsBackground = false }.Start();
@@ -456,7 +462,8 @@
        {
            //如果开启了自动跳转方案,则无需继续下面处理、无需手动跳转
            if (IsAutoJumpCallView) return;
            //先结束掉之前的线程
            EndCheckIncomingCallThread();
            //检测是否来电了如果是直接调整呼叫页面如果不是则开启线程等待判断
            if (IsIncomingReceivedCallState()) {
                Utlis.WriteLine("CALL 已经来电了。。。打开呼叫页面");
@@ -508,9 +515,13 @@
        /// </summary>
        Thread checkIncomingCallThread = null;
        /// <summary>
        /// 检测线程持续时间
        /// </summary>
        const int MAX_THREAD_TIME = 30;
        /// <summary>
        /// 线程结束
        /// </summary>
        int threadTime = 15;
        int threadTime = MAX_THREAD_TIME;
        /// <summary>
        /// 开启检测来电线程
        /// </summary>
@@ -519,7 +530,7 @@
            try
            {
                Utlis.WriteLine("CALL 还没来电,开启线程");
                threadTime = 15;
                threadTime = MAX_THREAD_TIME;
                //结束之前的线程
                EndCheckIncomingCallThread();
                //新建线程
@@ -542,6 +553,7 @@
                                    {
                                        GoToHDLLinphoneIntercomActivity();
                                    });
                                }
                            }
                          
@@ -566,9 +578,22 @@
                {
                    checkIncomingCallThread.Interrupt();
                }
                catch { }
                catch {
                }
                checkIncomingCallThread = null;
                Utlis.WriteLine("CALL 先结束线程");
            }
        }
        /// <summary>
        /// 判断线程是否启动了
        /// </summary>
        /// <returns></returns>
        public bool CheckIncomingCallThreadIsNull()
        {
            return checkIncomingCallThread == null || checkIncomingCallThread.ThreadState != ThreadState.Running;
        }
        #endregion
@@ -718,19 +743,19 @@
                hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL);
            }
            ///// <summary>
            ///// 截图成功
            ///// </summary>
            ///// <param name="image"></param>
            //public override void OnScreenshotSuccessfulAction(UIImage image)
            //{
            //    ////NSData imageData = UIImagePNGRepresentation(image); UIImage
            //    //NSData imageData = image.AsPNG();
            //    //byte[] dataBytes = new byte[imageData.Length];
            //    //System.Runtime.InteropServices.Marshal.Copy(imageData.Bytes, dataBytes, 0, Convert.ToInt32(imageData.Length));
            //    ////image.g
            //    ////hdlLinphone.ScreenshotSuccessfulAction(dataBytes);
            //}
            /// <summary>
            /// 截图成功
            /// </summary>
            /// <param name="image"></param>
            public override void OnScreenshotSuccessfulAction(UIImage image)
            {
                ////NSData imageData = UIImagePNGRepresentation(image); UIImage
                //NSData imageData = image.AsPNG();
                //byte[] dataBytes = new byte[imageData.Length];
                //System.Runtime.InteropServices.Marshal.Copy(imageData.Bytes, dataBytes, 0, Convert.ToInt32(imageData.Length));
                ////image.g
                ////hdlLinphone.ScreenshotSuccessfulAction(dataBytes);
            }
            /// <summary>
            /// 开锁成功
@@ -784,18 +809,6 @@
        /// 住宅Id
        /// </summary>
        public string HomeId = string.Empty;
        /// <summary>
        /// 账号
        /// </summary>
        public string Username = string.Empty;
        /// <summary>
        /// 密码
        /// </summary>
        public string Password = string.Empty;
        /// <summary>
        /// Domain
        /// </summary>
        public string Domain = string.Empty;
        /// <summary>
        /// 类型
        /// </summary>