From 9e9f864d0f630cacd36107e3960025f454c6881d Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 24 八月 2021 14:44:33 +0800
Subject: [PATCH] 2021-08-24 1.优化更新
---
HDL_APP_Project.sln | 14 ----
HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs | 78 +++++++++++++++-----------
HDL_ON/Common/ApiUtlis.cs | 25 +++++---
.vs/HDL_APP_Project/xs/UserPrefs.xml | 25 +++++---
DLL/Linphone/Android/Shared.Droid.HDLLinphone.dll | 0
5 files changed, 76 insertions(+), 66 deletions(-)
diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index f24ff57..ff33ecf 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,19 +1,26 @@
-锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
+锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
<MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008030-00014C392121802E" />
- <MonoDevelop.Ide.Workbench>
+ <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/Common/ApiUtlis.cs">
+ <Files>
+ <File FileName="HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs" Line="195" Column="44" />
+ <File FileName="HDL_ON/Common/ApiUtlis.cs" Line="287" Column="45" />
+ </Files>
<Pads>
<Pad Id="ProjectPad">
<State name="__root__">
<Node name="HDL_APP_Project" expanded="True">
<Node name="HDL_ON" expanded="True">
- <Node name="DAL" expanded="True">
- <Node name="ThirdPartySdk" expanded="True">
- <Node name="HDLLinphone.cs" selected="True" />
- </Node>
+ <Node name="Common" expanded="True">
+ <Node name="Utlis" expanded="True" />
+ <Node name="ApiUtlis.cs" selected="True" />
</Node>
- </Node>
- <Node name="Shared.IOS.HDLLinphoneSDK" expanded="True">
- <Node name="Properties" expanded="True" />
+ <Node name="DAL" expanded="True">
+ <Node name="ThirdPartySdk" expanded="True" />
+ </Node>
+ <Node name="UI" expanded="True">
+ <Node name="UI1-Login" expanded="True" />
+ <Node name="UI2" expanded="True" />
+ </Node>
</Node>
</Node>
</State>
diff --git a/DLL/Linphone/Android/Shared.Droid.HDLLinphone.dll b/DLL/Linphone/Android/Shared.Droid.HDLLinphone.dll
index 057fced..b07fa61 100644
--- a/DLL/Linphone/Android/Shared.Droid.HDLLinphone.dll
+++ b/DLL/Linphone/Android/Shared.Droid.HDLLinphone.dll
Binary files differ
diff --git a/HDL_APP_Project.sln b/HDL_APP_Project.sln
index dd41a42..6e5610f 100644
--- a/HDL_APP_Project.sln
+++ b/HDL_APP_Project.sln
@@ -9,8 +9,6 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blufi", "HdlBluWi\Blufi.csproj", "{2DDF4C3C-6998-432E-9F43-6786D82F0630}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared.IOS.HDLLinphoneSDK", "..\Linphone\HDLLinphoneSDK_IOS\Shared.IOS.HDLLinphoneSDK\Shared.IOS.HDLLinphoneSDK\Shared.IOS.HDLLinphoneSDK.csproj", "{9D978BB5-0B26-40BA-A7EC-C629B808D2BE}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -57,17 +55,5 @@
{2DDF4C3C-6998-432E-9F43-6786D82F0630}.Debug|iPhone.Build.0 = Debug|Any CPU
{2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|iPhone.ActiveCfg = Release|Any CPU
{2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|iPhone.Build.0 = Release|Any CPU
- {9D978BB5-0B26-40BA-A7EC-C629B808D2BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {9D978BB5-0B26-40BA-A7EC-C629B808D2BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9D978BB5-0B26-40BA-A7EC-C629B808D2BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {9D978BB5-0B26-40BA-A7EC-C629B808D2BE}.Release|Any CPU.Build.0 = Release|Any CPU
- {9D978BB5-0B26-40BA-A7EC-C629B808D2BE}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {9D978BB5-0B26-40BA-A7EC-C629B808D2BE}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {9D978BB5-0B26-40BA-A7EC-C629B808D2BE}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {9D978BB5-0B26-40BA-A7EC-C629B808D2BE}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
- {9D978BB5-0B26-40BA-A7EC-C629B808D2BE}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {9D978BB5-0B26-40BA-A7EC-C629B808D2BE}.Debug|iPhone.Build.0 = Debug|Any CPU
- {9D978BB5-0B26-40BA-A7EC-C629B808D2BE}.Release|iPhone.ActiveCfg = Release|Any CPU
- {9D978BB5-0B26-40BA-A7EC-C629B808D2BE}.Release|iPhone.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index e14a122..5736483 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -281,17 +281,22 @@
}
}
//======================鑾峰彇Sip璐﹀彿骞朵笖鍒濆鍖朣DK鍙瀵硅璁惧鍒楄〃====================
- if (isInterphoneType_HDL)
- {
- //HDLLinphone鍙瀵硅,鑾峰彇Sip璐﹀彿骞跺垵濮嬪寲SDK
- HDLLinphone.Current.GetHDLSipInfoAndInitSDK(DB_ResidenceData.Instance.CurrentRegion.id);
+ //濡傛灉妫�娴嬬嚎绋嬫病鍚姩锛屾墠缁х画涓嬮潰鎿嶄綔 鍥犱负App鍒氬惎鍔ㄩ┈涓婃敹鍒版帹閫佷簡锛岀劧鍚庢墠鎵ц鍒拌繖閲�
+ if (HDLLinphone.Current.CheckIncomingCallThreadIsNull()) {
+ //褰撳墠浣忓畢鏄疕DL鍙瀵硅绫诲瀷鐨勮澶�
+ if (isInterphoneType_HDL)
+ {
+ //HDLLinphone鍙瀵硅,鑾峰彇Sip璐﹀彿骞跺垵濮嬪寲SDK
+ HDLLinphone.Current.GetHDLSipInfoAndInitSDK(DB_ResidenceData.Instance.CurrentRegion.id);
+ }
+ else
+ {
+ Utlis.WriteLine("褰撳墠浣忓畢涓嶆敮鎸丠DL鍙瀵硅,閫�鍑虹櫥褰曟墍鏈夎处鍙�");
+ //褰撳墠浣忓畢涓嶆敮鎸丠DL鍙瀵硅
+ HDLLinphone.Current.LogoutAllAccount();
+ }
}
- else
- {
- Utlis.WriteLine("褰撳墠浣忓畢涓嶆敮鎸丠DL鍙瀵硅,閫�鍑虹櫥褰�");
- //褰撳墠浣忓畢涓嶆敮鎸丠DL鍙瀵硅
- HDLLinphone.Current.LogoutAllAccount();
- }
+
}
catch (Exception ex)
{
diff --git a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs
index bd931dc..7dfa239 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();
//鏂板缓绾跨▼
@@ -566,9 +577,22 @@
{
checkIncomingCallThread.Interrupt();
}
- catch { }
+ catch {
+
+ }
+
checkIncomingCallThread = null;
+ Utlis.WriteLine("CALL 鍏堢粨鏉熺嚎绋�");
}
+ }
+
+ /// <summary>
+ /// 鍒ゆ柇绾跨▼鏄惁鍚姩浜�
+ /// </summary>
+ /// <returns></returns>
+ public bool CheckIncomingCallThreadIsNull()
+ {
+ return checkIncomingCallThread == null;
}
#endregion
@@ -718,19 +742,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 +808,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