wxr
2024-05-20 efcffde735fa65ae34bae0bcc86313b74ed0e36c
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
                   );
            }
@@ -164,7 +165,14 @@
            Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().LogoutAllLinphoneUser();
#else
            HDLLinphoneKit.Instance.Logout();
            if (HDLLinphoneKit.Instance != null)
            {
                HDLLinphoneKit.Instance.Logout();
            }
            else
            {
            }
#endif
        }
@@ -226,7 +234,7 @@
                //先清空呼叫和监视设备信息
                if (clearCallInfo)
                {
                    InitCallInfo(null);
                    //InitCallInfo(null);//造成接收呼叫时开锁开锁异常
                }
                HDLSipInfo mHDLSipInfo = GetHDLSipInfo(mHDLCallVideoInfo.HomeId);
@@ -234,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);
                    });
                }
@@ -317,7 +338,7 @@
        #region ■  --  新接听和开锁接口_______________________________
        /// <summary>
        /// 开锁
        /// 可视对讲开锁
        /// </summary>
        public void HDLUnlockAction()
        {
@@ -337,6 +358,10 @@
                Application.RunOnMainThread(() =>
                {
                    if(revertObj == null)
                    {
                        return;
                    }
#if __IOS__
                    if (revertObj.Code == StateCode.SUCCESS)
@@ -429,7 +454,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.先呼叫设备
@@ -828,8 +859,6 @@
            {
                Utlis.WriteLine("OnIncomingCall :" + userName);
            }
        }