wxr
2024-09-30 dc9a1b15bb69227e19afc070adf58156a362d2a2
HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs
@@ -127,7 +127,17 @@
            //登录sip服务器
#if __IOS__
            Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().Login(mHDLSipInfo.sipAccount, mHDLSipInfo.sipPasswd, mHDLSipInfo.realm,"UDP");
            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())
            {
@@ -513,9 +523,16 @@
        /// 收到推送,后判断呼叫住宅是否为当前住宅,不是的话重新获取SIP账号并登录
        /// </summary>
        /// <param name="mESVideoInfo"></param>
        public void ShowESVideoIntercom(ESVideoInfo mESVideoInfo,string mInterphoneType)
        public void ShowESVideoIntercom(ESVideoInfo mESVideoInfo,string mInterphoneType, bool  isNotificationGoing = false)
        {
            if(this.mHDLCallVideoInfo != null)
#if __ANDROID__
            //isNotificationGoing参数是专门给安卓使用的,因为安卓在后面的时候已经启动了接听的界面了,从通知栏进来的时候,callid已经被使用了,所以要重置掉这个属性
            if (isNotificationGoing)
            {
                this.mHDLCallVideoInfo.CallId = "";
            }
#endif
            if (this.mHDLCallVideoInfo != null)
            {
                if(this.mHDLCallVideoInfo.CallId == mESVideoInfo.callId)
                {
@@ -578,6 +595,7 @@
                    intent.PutExtra("lpTitleName", mHDLCallVideoInfo.DeviceName);
                    intent.PutExtra("lpSipAccount", mHDLCallVideoInfo.DeviceSipAccount);
                }
                MainPage.Log("启动自研可视对讲界面");
                Shared.Application.Activity.StartActivity(intent);
#endif
            }
@@ -756,7 +774,14 @@
            public void OnAnswerAction()
            {
                //showToast("接听");
                HDLLinphoneKit.Instance.SetMediaPlayerLooping(false);
                try
                {
                    HDLLinphoneKit.Instance.SetMediaPlayerLooping(false);
                }
                catch (Exception ex)
                {
                    MainPage.Log("铃声关闭异常:" + ex.StackTrace);
                }
                hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL);
            }
            /// <summary>
@@ -776,10 +801,23 @@
            public void OnRejectCallAction()
            {
                //showToast("拒接");
                HDLLinphoneKit.Instance.SetMediaPlayerLooping(false);
                hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL);
                try
                {
                    HDLLinphoneKit.Instance.SetMediaPlayerLooping(false);
                }
                catch (Exception ex)
                {
                    MainPage.Log("铃声关闭异常:" + ex.StackTrace);
                }
                try
                {
                    hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL);
                }
                catch (Exception ex)
                {
                    MainPage.Log("OnRejectCallAction异常:" + ex.StackTrace);
                }
            }
            /// <summary>
            /// 截图成功事件
            /// </summary>
@@ -812,15 +850,43 @@
            /// </summary>
            public void OnCallAllRejection()
            {
                HDLLinphoneKit.Instance.SetMediaPlayerLooping(false);
                hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL);
                hdlLinphone.HDLRejectCallIn();
                try
                {
                    HDLLinphoneKit.Instance.SetMediaPlayerLooping(false);
                }
                catch (Exception ex)
                {
                    MainPage.Log("铃声关闭异常:" + ex.StackTrace);
                }
                try
                {
                    hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL);
                    hdlLinphone.HDLRejectCallIn();
                }
                catch (Exception ex)
                {
                    MainPage.Log("全部挂断异常:" + ex.StackTrace);
                }
            }
            public void OnMissedCallsAction()
            {
                HDLLinphoneKit.Instance.SetMediaPlayerLooping(false);
                hdlLinphone.HDLUpdateCallStatus(CallStatusType.MISSED, InterphoneType.HDL);
                try
                {
                    HDLLinphoneKit.Instance.SetMediaPlayerLooping(false);
                }
                catch (Exception ex)
                {
                    MainPage.Log("铃声关闭异常:" + ex.StackTrace);
                }
                try
                {
                    hdlLinphone.HDLUpdateCallStatus(CallStatusType.MISSED, InterphoneType.HDL);
                }
                catch (Exception ex)
                {
                    MainPage.Log("OnMissedCallsAction异常:" + ex.StackTrace);
                }
            }
        }