wxr
2024-09-24 691dbe24f5724f153e07947c7b75bdfea5f0b6d5
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,17 @@
            //登录sip服务器
#if __IOS__
            Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().Login(mHDLSipInfo.sipAccount, mHDLSipInfo.sipPasswd, mHDLSipInfo.realm);
            string systemVersion = UIKit.UIDevice.CurrentDevice.SystemVersion;
            System.Version currentVersion = new System.Version(systemVersion);
            System.Version version17 = new System.Version(17, 0);
            if (currentVersion.CompareTo(version17) > 0)
            {
                HDLLinPhoneSDK.Instance().Login(mHDLSipInfo.sipAccount, mHDLSipInfo.sipPasswd, mHDLSipInfo.realm, "udp");
            }
            else
            {
                HDLLinPhoneSDK.Instance().Login(mHDLSipInfo.sipAccount, mHDLSipInfo.sipPasswd, mHDLSipInfo.realm, DB_ResidenceData.Instance.linphoneConnectType.ToString());
            }
#else
            if (mInterphoneType == InterphoneType.FREEVIEW.ToString())
            {
@@ -135,7 +146,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 +158,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
@@ -607,7 +620,7 @@
        bool IsIncomingReceivedCallState()
        {
#if __IOS__
            return Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().IsIncomingReceivedCallState;
            return HDLLinPhoneSDK.Instance().IsIncomingReceivedCallState;
#else
            return HDLLinphoneKit.Instance.IsIncomingReceivedCallState;
#endif
@@ -620,6 +633,7 @@
#if __IOS__
            HDLLinPhoneSDK.Instance().GotoHDLLinphoneIntercomVC(mHDLCallVideoInfo.DeviceName);
#else
@@ -885,6 +899,7 @@
            /// </summary>
            public override void OnRejectCallAction()
            {
                MainPage.Log("iOS 全部拒接");
                Other.SoundPlayer.Ins.StopSound();
                hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL);
            }
@@ -893,7 +908,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();
@@ -919,6 +934,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