From eda3fb873e59544ff36301b51e05aef64f87b0f9 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期五, 27 八月 2021 13:21:21 +0800 Subject: [PATCH] Merge branch 'newBranch1' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into newBranch1 --- HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs | 79 +++++++++++++++++++++++---------------- 1 files changed, 46 insertions(+), 33 deletions(-) diff --git a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs index bd931dc..68cec3c 100644 --- a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs +++ b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs @@ -192,12 +192,18 @@ /// 璇锋眰鏈嶅姟鍣ㄨ幏鍙栧綋鍓嶄綇瀹匰ip璐﹀彿淇℃伅骞跺垵濮嬪寲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> -- Gitblit v1.8.0