From 16bea1d248f0010049bceaa562939297fa26b130 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期四, 25 七月 2024 15:27:21 +0800
Subject: [PATCH] Merge branch 'Dev-Branch-2024' into wjc
---
HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs | 77 ++++++++++++++++++++++++++++++++------
1 files changed, 65 insertions(+), 12 deletions(-)
diff --git a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs
index 13c9e3c..a7a7453 100644
--- a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs
+++ b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs
@@ -124,8 +124,8 @@
+ //鐧诲綍sip鏈嶅姟鍣�
#if __IOS__
-
Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().Login(mHDLSipInfo.sipAccount, mHDLSipInfo.sipPasswd, mHDLSipInfo.realm);
#else
if (mInterphoneType == InterphoneType.FREEVIEW.ToString())
@@ -133,8 +133,8 @@
HDLLinphoneKit.Instance.SetAccountAndLogin(
mHDLSipInfo.sipAccount,
mHDLSipInfo.sipPasswd,
- "139.159.157.75:47000",//mHDLSipInfo.realm,
- "sip:139.159.157.75:47000;transport=udp",
+ mHDLSipInfo.realm,
+ //"sip:139.159.157.75:47000;transport=udp",
HDLLinphoneKit.InterPhoneTypeFreeview
);
}
@@ -144,7 +144,8 @@
mHDLSipInfo.sipAccount,
mHDLSipInfo.sipPasswd,
mHDLSipInfo.realm,
- "sip:139.159.157.75:47000;transport=udp",
+ //mHDLSipInfo.proxy+ ";transport=udp",
+ //"sip:139.159.157.75:47000;transport=udp",
HDLLinphoneKit.InterPhoneTypeHdl
);
}
@@ -233,7 +234,7 @@
//鍏堟竻绌哄懠鍙拰鐩戣璁惧淇℃伅
if (clearCallInfo)
{
- InitCallInfo(null);
+ //InitCallInfo(null);//閫犳垚鎺ユ敹鍛煎彨鏃跺紑閿佸紑閿佸紓甯�
}
HDLSipInfo mHDLSipInfo = GetHDLSipInfo(mHDLCallVideoInfo.HomeId);
@@ -241,9 +242,22 @@
{
Application.RunOnMainThread(() =>
{
- InitLinphone();
+ try
+ {
+ InitLinphone();
+ }
+ catch (Exception ex)
+ {
+ MainPage.Log($"InitLinphone exception : {ex.Message}");
+ }
mHDLSipInfo.homeId = mHDLCallVideoInfo.HomeId;
- SetAccountAndLogin(mHDLSipInfo, mHDLCallVideoInfo.InterphoneType);
+ try {
+ SetAccountAndLogin(mHDLSipInfo, mHDLCallVideoInfo.InterphoneType);
+ }
+ catch (Exception ex)
+ {
+ MainPage.Log($"SetAccountAndLogin exception : {ex.Message}");
+ }
Utlis.WriteLine("CALL 鑾峰彇SIP璐﹀彿鎴愬姛锛�" + mHDLSipInfo.sipAccount);
});
}
@@ -324,7 +338,7 @@
#region 鈻� -- 鏂版帴鍚拰寮�閿佹帴鍙______________________________
/// <summary>
- /// 寮�閿�
+ /// 鍙瀵硅寮�閿�
/// </summary>
public void HDLUnlockAction()
{
@@ -344,6 +358,10 @@
Application.RunOnMainThread(() =>
{
+ if(revertObj == null)
+ {
+ return;
+ }
#if __IOS__
if (revertObj.Code == StateCode.SUCCESS)
@@ -408,9 +426,39 @@
{ IsBackground = false }.Start();
}
+ /// <summary>
+ /// 鎷掓帴锛堟寕娈垫墍鏈夊懠鍙級
+ /// </summary>
+ public void HDLRejectCallIn() {
+
+ if (CheckmHDLCallVideoInfoIsNullOrEmpty()) return;
+
+ new Thread(() =>
+ {
+ Dictionary<string, object> dic = new Dictionary<string, object>();
+ dic.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ dic.Add("deviceId", mHDLCallVideoInfo.DeviceId);
+ dic.Add("interphoneType", "HDL");
+ dic.Add("callId", mHDLCallVideoInfo.CallId);//鍛煎彨id
+
+ var requestJson = HttpUtil.GetSignRequestJson(dic);
+ var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_VideoDevice_RejectCallIn, requestJson);
+ if (revertObj.Code == StateCode.SUCCESS)
+ {
+
+ }
+ else
+ {
+ Utlis.WriteLine("POST 鏇存柊鐘舵�佸け璐� code: " + revertObj.Code);
+ }
+
+ })
+ { IsBackground = false }.Start();
+ }
+
#endregion
-
+
#region 鈻� -- 璺宠浆鐩戞帶椤甸潰_______________________________
/// <summary>
/// 璺宠浆鐩戞帶椤甸潰
@@ -436,7 +484,13 @@
#if __IOS__
- Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().CallWithUserName(mHDLCallVideoInfo.DeviceSipAccount, mHDLCallVideoInfo.DeviceName);
+ if (mHDLCallVideoInfo.spk == "door.gate")
+ {
+ Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().CallHDLSRWithUserName(mHDLCallVideoInfo.DeviceSipAccount, mHDLCallVideoInfo.DeviceName);
+ }else{
+ Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().CallWithUserName(mHDLCallVideoInfo.DeviceSipAccount, mHDLCallVideoInfo.DeviceName);
+ }
+
#else
//1.鍏堝懠鍙澶�
@@ -710,6 +764,7 @@
{
//showToast("鎷掓帴");
hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL);
+ hdlLinphone.HDLRejectCallIn();
}
/// <summary>
@@ -835,8 +890,6 @@
{
Utlis.WriteLine("OnIncomingCall :" + userName);
}
-
-
}
--
Gitblit v1.8.0