| | |
| | | using HDL_ON.Entity; |
| | | using System.Threading; |
| | | using HDL_ON.DriverLayer; |
| | | #if __IOS__ |
| | | using Other; |
| | | using Shared.IOS.HDLLinphoneSDK; |
| | | #endif |
| | | namespace HDL_ON |
| | | { |
| | | /// <summary> |
| | |
| | | { |
| | | try |
| | | { |
| | | Console.WriteLine($"接收到推送,,,,.{Newtonsoft.Json.JsonConvert.SerializeObject(jpushMessageInfo).ToString()}"); |
| | | //Console.WriteLine($"接收到推送,,,,.{Newtonsoft.Json.JsonConvert.SerializeObject(jpushMessageInfo).ToString()}"); |
| | | |
| | | //Extras为空不处理 |
| | | if (string.IsNullOrEmpty(jpushMessageInfo.Extras)) return; |
| | |
| | | ESOnVideo.Current.ShowESvideoVideoIntercom(eSVideoInfo, InterphoneType.FLVI.ToString()); |
| | | |
| | | } |
| | | else if (jpushMessageInfo.messageType == (PushMessageType.HDL_INTERPHONE.ToString())) |
| | | else if (jpushMessageInfo.messageType == PushMessageType.HDL_INTERPHONE.ToString()) |
| | | { |
| | | |
| | | if (string.IsNullOrEmpty(jpushMessageInfo.expantContent)) return; |
| | | |
| | | //字段兼容问题,只能直接取值了 |
| | | var json = Newtonsoft.Json.Linq.JObject.Parse(jpushMessageInfo.expantContent); |
| | | try |
| | | { |
| | | //var pushHomeId = json["homeId"]; |
| | | //if (pushHomeId == null || string.IsNullOrEmpty(pushHomeId.ToString())){ |
| | | // Console.WriteLine("homeId is null"); |
| | | // return; |
| | | //} |
| | | var pushTime = json["pushTime"]; |
| | | if (pushTime == null) |
| | | { |
| | | //return; |
| | | } |
| | | else |
| | | { |
| | | if (!string.IsNullOrEmpty(pushTime.ToString())) |
| | | { |
| | | var pushDateTime = Utlis.UnixToDateTimeMS(Convert.ToInt64(pushTime)); |
| | | if (pushDateTime.AddSeconds(30) < DateTime.Now) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch { } |
| | | |
| | | |
| | | //1.视对讲厂家类型 |
| | | string interphoneTypeEnum = json["interphoneTypeEnum"].ToString(); |
| | |
| | | } |
| | | else if (interphoneTypeEnum == InterphoneType.HDL.ToString()) |
| | | { |
| | | try |
| | | { |
| | | var pushTime = json["pushTime"]; |
| | | if (pushTime == null) |
| | | { |
| | | return; |
| | | } |
| | | if (!string.IsNullOrEmpty(pushTime.ToString())) |
| | | { |
| | | var pushDateTime = Utlis.UnixToDateTimeMS(Convert.ToInt64(pushTime)); |
| | | if (pushDateTime.AddSeconds(30) < DateTime.Now) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | catch { } |
| | | |
| | | |
| | | |
| | | #if __ANDROID__ |
| | | Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.MissedCallsTime = 30; |
| | | Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.SetMediaPlayerLooping(true); |
| | | Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.PlayRingtone(); |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | DateTime dateTime = DateTime.Now; |
| | | while (true) |
| | | { |
| | | Thread.Sleep(1000); |
| | | if (!Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.MediaPlayerPlayingStatus || dateTime.AddSeconds(Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.MissedCallsTime) <= DateTime.Now) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.SetMediaPlayerLooping(false); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("error", "自研可视对讲铃声播放异常:" + ex.Message); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | #elif __IOS__ |
| | | SoundPlayer.Ins.PlaySound(); |
| | | new Thread(() => { |
| | | int count = 0; |
| | | while (true) |
| | | { |
| | | if (SoundPlayer.Ins.player == null) |
| | | { |
| | | break; |
| | | } |
| | | if (!SoundPlayer.Ins.player.Playing) |
| | | { |
| | | break; |
| | | } |
| | | System.Threading.Thread.Sleep(1000); |
| | | count++; |
| | | MainPage.Log("linphone 呼叫计时:" + count); |
| | | if (count > 29) |
| | | { |
| | | SoundPlayer.Ins.StopSound(); |
| | | Application.RunOnMainThread(() => { |
| | | try |
| | | { |
| | | HDLLinPhoneSDK.Instance().HideIntercomeVC(); |
| | | }catch(Exception ex) |
| | | { |
| | | MainPage.Log("error", "ios linphone 呼叫超时关闭界面异常:" + ex.Message); |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | #endif |
| | | |
| | | |
| | | //HDL Linphone 狄耐克 |
| | | eSVideoInfo.HomeId = jpushMessageInfo.HomeId; |
| | | eSVideoInfo.callId = json["callId"].ToString(); |
| | |
| | | eSVideoInfo.DeviceName = json["deviceName"].ToString(); |
| | | eSVideoInfo.deviceSipAccount = json["deviceSipAccount"].ToString(); |
| | | eSVideoInfo.spk = json["spk"].ToString(); |
| | | |
| | | |
| | | //ShowAlert("狄耐克门口机呼叫"); |
| | | //打开呼叫页面 |
| | |
| | | ((BaseActivity)Shared.Application.Activity).SetPermission(result => |
| | | { |
| | | //2023年03月29日13:08:35 修改 |
| | | Com.Videogo.Hdl.HDLEzvizSdk.Instance.Init(Application.Activity.Application, ezChildAccessToken, UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken, OnAppConfig.Instance.RequestHttpsHost, "1aa98a90489b4838b966b57018b4b04b", 1, DB_ResidenceData.Instance.CurrentRegion.id); |
| | | Com.Videogo.Hdl.HDLEzvizSdk.Instance.Init(Application.Activity.Application, ezChildAccessToken, UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken, OnAppConfig.Instance.RequestHttpsHost, "1aa98a90489b4838b966b57018b4b04b", 1, DB_ResidenceData.Instance.CurrentRegion.id, |
| | | HttpUtil.APP_KEY, HttpUtil.SECRET_KEY); |
| | | Com.Videogo.Hdl.HDLEzvizSdk.Instance.JumpToCameraListActivity(Shared.Application.Activity, list); |
| | | //if (result) |
| | | //{ |
| | |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(result.Code); |
| | | if (result.Code != "-1") |
| | | IMessageCommon.Current.ShowErrorInfoAlter(result.Code); |
| | | } |
| | | } |
| | | catch (Exception ex) |