From 38a11bcfaf3cf703e38201c9c6cd6631354ea243 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 30 十一月 2021 09:55:09 +0800
Subject: [PATCH] Siri功能完成
---
HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs | 73 +++++++++++++++++++++---------------
1 files changed, 43 insertions(+), 30 deletions(-)
diff --git a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs
index bd931dc..49857bf 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,18 +743,18 @@
hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL);
}
- ///// <summary>
- ///// 鎴浘鎴愬姛
- ///// </summary>
- ///// <param name="image"></param>
+ /// <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);
+ ////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