From c00da77d00a479fa5d022346a6d9075f90a5c087 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期六, 14 九月 2024 10:05:34 +0800
Subject: [PATCH] 退出登录时间调整,新风,音乐

---
 HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs |   92 ++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 84 insertions(+), 8 deletions(-)

diff --git a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs
index d26ebf5..4898a28 100644
--- a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs
+++ b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs
@@ -13,6 +13,7 @@
 using Android.Widget;
 using Com.Hdl.Hdllinphonesdk;
 #else
+using Other;
 using Foundation;
 using UIKit;
 using Shared.IOS.HDLLinphoneSDK;
@@ -126,7 +127,7 @@
 
             //鐧诲綍sip鏈嶅姟鍣�
 #if __IOS__
-            Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().Login(mHDLSipInfo.sipAccount, mHDLSipInfo.sipPasswd, mHDLSipInfo.realm);
+            Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().Login(mHDLSipInfo.sipAccount, mHDLSipInfo.sipPasswd, mHDLSipInfo.realm,"UDP");
 #else
             if (mInterphoneType == InterphoneType.FREEVIEW.ToString())
             {
@@ -135,7 +136,8 @@
                     mHDLSipInfo.sipPasswd,
                     mHDLSipInfo.realm,
                     //"sip:139.159.157.75:47000;transport=udp",
-                    HDLLinphoneKit.InterPhoneTypeFreeview
+                    HDLLinphoneKit.InterPhoneTypeFreeview,
+                    DB_ResidenceData.Instance.linphoneConnectType.ToString()
                     );
             }
             else
@@ -146,7 +148,8 @@
                    mHDLSipInfo.realm,
                    //mHDLSipInfo.proxy+ ";transport=udp",
                    //"sip:139.159.157.75:47000;transport=udp",
-                   HDLLinphoneKit.InterPhoneTypeHdl
+                   HDLLinphoneKit.InterPhoneTypeHdl,
+                    DB_ResidenceData.Instance.linphoneConnectType.ToString()
                    );
             }
 #endif
@@ -426,9 +429,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>
         /// 璺宠浆鐩戞帶椤甸潰
@@ -482,6 +515,14 @@
         /// <param name="mESVideoInfo"></param>
         public void ShowESVideoIntercom(ESVideoInfo mESVideoInfo,string mInterphoneType)
         {
+            if(this.mHDLCallVideoInfo != null)
+            {
+                if(this.mHDLCallVideoInfo.CallId == mESVideoInfo.callId)
+                {
+                    return;
+                }
+            }
+
             InitLinphone();
 
             HDLCallVideoInfo mHDLCallVideoInfo = new HDLCallVideoInfo();
@@ -528,7 +569,7 @@
             {
 #if __IOS__
                 //鑷爺鍙瀵硅
-                Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().GotoHDLSRLinphoneIntercomVC(mHDLCallVideoInfo.DeviceName, mHDLCallVideoInfo.DeviceSipAccount);
+                HDLLinPhoneSDK.Instance().GotoHDLSRLinphoneIntercomVC(mHDLCallVideoInfo.DeviceName, mHDLCallVideoInfo.DeviceSipAccount);
 #else
                 var intent = new Intent(Shared.Application.Activity, typeof(Com.Hdl.Hdllinphonesdk.Activity.HDLLinphoneReverseCallActivity));  
                 if (mHDLCallVideoInfo != null)
@@ -569,7 +610,7 @@
         bool IsIncomingReceivedCallState()
         {
 #if __IOS__
-            return Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().IsIncomingReceivedCallState;
+            return HDLLinPhoneSDK.Instance().IsIncomingReceivedCallState;
 #else
             return HDLLinphoneKit.Instance.IsIncomingReceivedCallState;
 #endif
@@ -582,7 +623,8 @@
 
 #if __IOS__
 
-            Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().GotoHDLLinphoneIntercomVC(mHDLCallVideoInfo.DeviceName);
+            
+            HDLLinPhoneSDK.Instance().GotoHDLLinphoneIntercomVC(mHDLCallVideoInfo.DeviceName);
 
 #else
             var intent = new Intent(Shared.Application.Activity, typeof(Com.Hdl.Hdllinphonesdk.Activity.HDLLinphoneIntercomActivity));
@@ -714,6 +756,7 @@
             public void OnAnswerAction()
             {
                 //showToast("鎺ュ惉");
+                HDLLinphoneKit.Instance.SetMediaPlayerLooping(false);
                 hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL);
             }
             /// <summary>
@@ -733,6 +776,7 @@
             public void OnRejectCallAction()
             {
                 //showToast("鎷掓帴");
+                HDLLinphoneKit.Instance.SetMediaPlayerLooping(false);
                 hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL);
             }
 
@@ -760,6 +804,23 @@
             public void OnIncomingCall(string userName)
             {
                 Utlis.WriteLine("OnIncomingCall :" + userName);
+            }
+
+            /// <summary>
+            /// 鎷掓帴浜嬩欢
+            /// 鍏ㄩ儴鎸傛柇
+            /// </summary>
+            public void OnCallAllRejection()
+            {
+                HDLLinphoneKit.Instance.SetMediaPlayerLooping(false);
+                hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL);
+                hdlLinphone.HDLRejectCallIn();
+            }
+
+            public void OnMissedCallsAction()
+            {
+                HDLLinphoneKit.Instance.SetMediaPlayerLooping(false);
+                hdlLinphone.HDLUpdateCallStatus(CallStatusType.MISSED, InterphoneType.HDL);
             }
         }
 
@@ -810,6 +871,7 @@
             /// </summary>
             public override void OnAnswerAction()
             {
+                Other.SoundPlayer.Ins.StopSound();
                 hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL);
             }
 
@@ -827,6 +889,8 @@
             /// </summary>
             public override void OnRejectCallAction()
             {
+                MainPage.Log("iOS 鍏ㄩ儴鎷掓帴");
+                Other.SoundPlayer.Ins.StopSound();
                 hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL);
             }
 
@@ -834,7 +898,7 @@
             /// 鎴浘鎴愬姛
             /// </summary>
             /// <param name = "image" ></ param >
-            public  void OnScreenshotSuccessfulAction(UIImage image)
+            public override void OnScreenshotSuccessfulAction(UIImage image)
             {
                 //NSData imageData = UIImagePNGRepresentation(image); UIImage
                 NSData imageData = image.AsPNG();
@@ -860,6 +924,18 @@
                 Utlis.WriteLine("OnIncomingCall :" + userName);
             }
 
+            public override void OnRejectAllCallAction()
+            {
+                MainPage.Log("iOS 鍏ㄩ儴鎷掓帴");
+                Other.SoundPlayer.Ins.StopSound();
+                hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL);
+                hdlLinphone.HDLRejectCallIn();
+            }
+
+            //public override void OnScreenshotSuccessfulAction(UIImage image)
+            //{
+            //    throw new NotImplementedException();
+            //}
         }
 
         #endregion

--
Gitblit v1.8.0