From 90d4fdb42a7f4818897ff76def0a151a99d2d9e1 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 23 十一月 2023 13:56:14 +0800 Subject: [PATCH] 2.4.2Google --- HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs | 1622 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 811 insertions(+), 811 deletions(-) diff --git a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs index d26ebf5..8cc2906 100644 --- a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs +++ b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs @@ -1,936 +1,936 @@ -锘縰sing System; -using System.Collections.Generic; -using System.Threading; +锘�//using System; +//using System.Collections.Generic; +//using System.Threading; -using HDL_ON; -using HDL_ON.DAL.Server; -using HDL_ON.Entity; +//using HDL_ON; +//using HDL_ON.DAL.Server; +//using HDL_ON.Entity; -#if __Android__ -using Android.App; -using Android.Content; -using Android.Graphics; -using Android.Widget; -using Com.Hdl.Hdllinphonesdk; -#else -using Foundation; -using UIKit; -using Shared.IOS.HDLLinphoneSDK; -#endif +//#if __Android__ +//using Android.App; +//using Android.Content; +//using Android.Graphics; +//using Android.Widget; +////using Com.Hdl.Hdllinphonesdk; +//#else +//using Foundation; +//using UIKit; +//using Shared.IOS.HDLLinphoneSDK; +//#endif -namespace Shared -{ - /// <summary> - /// 鐩墠鏄瘡涓綇瀹呭搴斾竴涓猄IP璐﹀彿锛屽垏鎹綇瀹呴渶瑕侀噸鏂拌幏鍙朣IP璐﹀彿 - /// </summary> - public class HDLLinphone - { - /// <summary> - /// - /// </summary> - public HDLLinphone() - { +//namespace Shared +//{ +// /// <summary> +// /// 鐩墠鏄瘡涓綇瀹呭搴斾竴涓猄IP璐﹀彿锛屽垏鎹綇瀹呴渶瑕侀噸鏂拌幏鍙朣IP璐﹀彿 +// /// </summary> +// public class HDLLinphone +// { +// /// <summary> +// /// +// /// </summary> +// public HDLLinphone() +// { - } - /// <summary> - /// - /// </summary> - private static HDLLinphone m_Current = null; - /// <summary> - /// - /// </summary> - public static HDLLinphone Current - { - get - { - if (m_Current == null) - { - m_Current = new HDLLinphone(); - } - return m_Current; - } - } +// } +// /// <summary> +// /// +// /// </summary> +// private static HDLLinphone m_Current = null; +// /// <summary> +// /// +// /// </summary> +// public static HDLLinphone Current +// { +// get +// { +// if (m_Current == null) +// { +// m_Current = new HDLLinphone(); +// } +// return m_Current; +// } +// } - /// <summary> - /// 褰撳墠浣忓畢鏄惁鏀寔鍙瀵硅 - /// </summary> - public bool IsEnable = false; - /// <summary> - /// 褰撳墠瑙嗛閫氳瘽鏄惁涓鸿嚜鐮� - /// </summary> - public bool IsSelfResearch = false; - /// <summary> - /// 鏄惁鑷姩璺宠浆鍛煎彨椤甸潰, - /// false锛氭敹鍒版帹閫佸苟涓斿凡缁忔敹鍒皊ip鍛煎彨鎵嶈烦杞懠鍙〉闈� - /// true锛氬師鐢熸敹鍒板懠鍙┈涓婅烦杞懠鍙〉闈紝涓嶇瓑寰呮帹閫佽繃鏉� - /// </summary> - bool IsAutoJumpCallView = true; - /// <summary> - /// 鏄惁鍒濆鍖栦簡SDK - /// </summary> - bool IsInitSdk; - /// <summary> - /// 褰撳墠鐧诲綍鐨凷ip璐﹀彿 - /// </summary> - HDLSipInfo currentHDLSipInfo; - /// <summary> - /// 鍙瀵硅璁惧鍙傛暟 - /// </summary> - HDLCallVideoInfo mHDLCallVideoInfo; +// /// <summary> +// /// 褰撳墠浣忓畢鏄惁鏀寔鍙瀵硅 +// /// </summary> +// public bool IsEnable = false; +// /// <summary> +// /// 褰撳墠瑙嗛閫氳瘽鏄惁涓鸿嚜鐮� +// /// </summary> +// public bool IsSelfResearch = false; +// /// <summary> +// /// 鏄惁鑷姩璺宠浆鍛煎彨椤甸潰, +// /// false锛氭敹鍒版帹閫佸苟涓斿凡缁忔敹鍒皊ip鍛煎彨鎵嶈烦杞懠鍙〉闈� +// /// true锛氬師鐢熸敹鍒板懠鍙┈涓婅烦杞懠鍙〉闈紝涓嶇瓑寰呮帹閫佽繃鏉� +// /// </summary> +// bool IsAutoJumpCallView = true; +// /// <summary> +// /// 鏄惁鍒濆鍖栦簡SDK +// /// </summary> +// bool IsInitSdk; +// /// <summary> +// /// 褰撳墠鐧诲綍鐨凷ip璐﹀彿 +// /// </summary> +// HDLSipInfo currentHDLSipInfo; +// /// <summary> +// /// 鍙瀵硅璁惧鍙傛暟 +// /// </summary> +// HDLCallVideoInfo mHDLCallVideoInfo; - #region 鈻� -- 鍒濆鍖朣DK_______________________________ - /// <summary> - /// 鍒濆鍖朣DK - /// </summary> - void InitLinphone() - { - //闃叉閲嶅鍒濆鍖� - if (IsInitSdk) return; +// #region 鈻� -- 鍒濆鍖朣DK_______________________________ +// /// <summary> +// /// 鍒濆鍖朣DK +// /// </summary> +// void InitLinphone() +// { +// //闃叉閲嶅鍒濆鍖� +// if (IsInitSdk) return; - IsInitSdk = true; +// IsInitSdk = true; -#if __IOS__ +//#if __IOS__ - Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().InitalLinPhone(); - //璁剧疆鏀跺埌鏉ョ數鍚庛�佹槸鍚﹂渶鑷姩璺宠浆鍛煎彨椤甸潰鏂规 - Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().IsAutoJumpCallView = IsAutoJumpCallView; - //璁剧疆Listener鐩戝惉(Shared.IOS.HDLLinphoneSDK) - mOnHDLLinphoneCallDelegate = new OnHDLLinphoneCallDelegate(this); - Console.WriteLine(UserInfo.Current.ID); - Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().HdlLinphoneCallDelegate = mOnHDLLinphoneCallDelegate; -#else - HDLLinphoneKit.Instance.InitLinphone(Application.Activity); - //璁剧疆鏀跺埌鏉ョ數鍚庛�佹槸鍚﹂渶鑷姩璺宠浆鍛煎彨椤甸潰鏂规 - HDLLinphoneKit.Instance.AutoJumpCallView = IsAutoJumpCallView; - //璁剧疆Listener鐩戝惉 - setOnHDLLinphoneCallListener(); -#endif - } +// Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().InitalLinPhone(); +// //璁剧疆鏀跺埌鏉ョ數鍚庛�佹槸鍚﹂渶鑷姩璺宠浆鍛煎彨椤甸潰鏂规 +// Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().IsAutoJumpCallView = IsAutoJumpCallView; +// //璁剧疆Listener鐩戝惉(Shared.IOS.HDLLinphoneSDK) +// mOnHDLLinphoneCallDelegate = new OnHDLLinphoneCallDelegate(this); +// Console.WriteLine(UserInfo.Current.ID); +// Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().HdlLinphoneCallDelegate = mOnHDLLinphoneCallDelegate; +//#else +// HDLLinphoneKit.Instance.InitLinphone(Application.Activity); +// //璁剧疆鏀跺埌鏉ョ數鍚庛�佹槸鍚﹂渶鑷姩璺宠浆鍛煎彨椤甸潰鏂规 +// HDLLinphoneKit.Instance.AutoJumpCallView = IsAutoJumpCallView; +// //璁剧疆Listener鐩戝惉 +// setOnHDLLinphoneCallListener(); +//#endif +// } - /// <summary> - /// 璁剧疆sip鐧诲綍璐﹀彿 - /// </summary> - /// <param name="mHDLSipInfo"></param> - public void SetAccountAndLogin(HDLSipInfo mHDLSipInfo, string mInterphoneType) - { +// /// <summary> +// /// 璁剧疆sip鐧诲綍璐﹀彿 +// /// </summary> +// /// <param name="mHDLSipInfo"></param> +// public void SetAccountAndLogin(HDLSipInfo mHDLSipInfo, string mInterphoneType) +// { - this.currentHDLSipInfo = mHDLSipInfo; +// this.currentHDLSipInfo = mHDLSipInfo; - if (mHDLSipInfo == null) { - //new alert - return; - } +// if (mHDLSipInfo == null) { +// //new alert +// return; +// } - //鐧诲綍sip鏈嶅姟鍣� -#if __IOS__ - Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().Login(mHDLSipInfo.sipAccount, mHDLSipInfo.sipPasswd, mHDLSipInfo.realm); -#else - if (mInterphoneType == InterphoneType.FREEVIEW.ToString()) - { - HDLLinphoneKit.Instance.SetAccountAndLogin( - mHDLSipInfo.sipAccount, - mHDLSipInfo.sipPasswd, - mHDLSipInfo.realm, - //"sip:139.159.157.75:47000;transport=udp", - HDLLinphoneKit.InterPhoneTypeFreeview - ); - } - else - { - HDLLinphoneKit.Instance.SetAccountAndLogin( - mHDLSipInfo.sipAccount, - mHDLSipInfo.sipPasswd, - mHDLSipInfo.realm, - //mHDLSipInfo.proxy+ ";transport=udp", - //"sip:139.159.157.75:47000;transport=udp", - HDLLinphoneKit.InterPhoneTypeHdl - ); - } -#endif - } +// //鐧诲綍sip鏈嶅姟鍣� +//#if __IOS__ +// Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().Login(mHDLSipInfo.sipAccount, mHDLSipInfo.sipPasswd, mHDLSipInfo.realm); +//#else +// if (mInterphoneType == InterphoneType.FREEVIEW.ToString()) +// { +// HDLLinphoneKit.Instance.SetAccountAndLogin( +// mHDLSipInfo.sipAccount, +// mHDLSipInfo.sipPasswd, +// mHDLSipInfo.realm, +// //"sip:139.159.157.75:47000;transport=udp", +// HDLLinphoneKit.InterPhoneTypeFreeview +// ); +// } +// else +// { +// HDLLinphoneKit.Instance.SetAccountAndLogin( +// mHDLSipInfo.sipAccount, +// mHDLSipInfo.sipPasswd, +// mHDLSipInfo.realm, +// //mHDLSipInfo.proxy+ ";transport=udp", +// //"sip:139.159.157.75:47000;transport=udp", +// HDLLinphoneKit.InterPhoneTypeHdl +// ); +// } +//#endif +// } - /// <summary> - /// 娉ㄩ攢鎵�鏈夎处鍙� - /// </summary> - public void LogoutAllAccount() { - //娌″垵濮嬪寲杩囧垯杩斿洖 - if (!IsInitSdk) return; +// /// <summary> +// /// 娉ㄩ攢鎵�鏈夎处鍙� +// /// </summary> +// public void LogoutAllAccount() { +// //娌″垵濮嬪寲杩囧垯杩斿洖 +// if (!IsInitSdk) return; - this.currentHDLSipInfo = null; - this.mHDLCallVideoInfo = null; -#if __IOS__ +// this.currentHDLSipInfo = null; +// this.mHDLCallVideoInfo = null; +//#if __IOS__ - Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().LogoutAllLinphoneUser(); -#else - if (HDLLinphoneKit.Instance != null) - { - HDLLinphoneKit.Instance.Logout(); - } - else - { +// Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().LogoutAllLinphoneUser(); +//#else +// if (HDLLinphoneKit.Instance != null) +// { +// HDLLinphoneKit.Instance.Logout(); +// } +// else +// { - } -#endif - } +// } +//#endif +// } - /// <summary> - /// 娓呴櫎閰嶇疆琛� - /// </summary> - public void ClearProxyConfig() - { -#if __IOS__ +// /// <summary> +// /// 娓呴櫎閰嶇疆琛� +// /// </summary> +// public void ClearProxyConfig() +// { +//#if __IOS__ - Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().ClearAllConfigs(); -#else - HDLLinphoneKit.Instance.ClearProxyConfig(); -#endif - } +// Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().ClearAllConfigs(); +//#else +// HDLLinphoneKit.Instance.ClearProxyConfig(); +//#endif +// } - #endregion +// #endregion - #region 鈻� -- 鑾峰彇sip璐﹀彿_______________________________ - /// <summary> - /// 鑾峰彇褰撳墠浣忓畢鐨凷IP璐﹀彿 - /// </summary> - public HDLSipInfo GetHDLSipInfo(string homeId) - { - Dictionary<string, object> d = new Dictionary<string, object>(); - d.Add("homeId", homeId); +// #region 鈻� -- 鑾峰彇sip璐﹀彿_______________________________ +// /// <summary> +// /// 鑾峰彇褰撳墠浣忓畢鐨凷IP璐﹀彿 +// /// </summary> +// public HDLSipInfo GetHDLSipInfo(string homeId) +// { +// Dictionary<string, object> d = new Dictionary<string, object>(); +// d.Add("homeId", homeId); - var requestJson = HttpUtil.GetSignRequestJson(d); - var resultObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_VideoDevice_GetSipAccount, requestJson); +// var requestJson = HttpUtil.GetSignRequestJson(d); +// var resultObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_VideoDevice_GetSipAccount, requestJson); - if (resultObj.Code == StateCode.SUCCESS) - { - if (string.IsNullOrEmpty(resultObj.Data.ToString())) - { - //鎺х殑璇濅唬琛ㄥ綋鍓嶄綇瀹呬笉鏀寔 - return null; - } - else - { - var info = Newtonsoft.Json.JsonConvert.DeserializeObject<HDLSipInfo>(resultObj.Data.ToString()); - return info; - } - } - else - { - return null; - } +// if (resultObj.Code == StateCode.SUCCESS) +// { +// if (string.IsNullOrEmpty(resultObj.Data.ToString())) +// { +// //鎺х殑璇濅唬琛ㄥ綋鍓嶄綇瀹呬笉鏀寔 +// return null; +// } +// else +// { +// var info = Newtonsoft.Json.JsonConvert.DeserializeObject<HDLSipInfo>(resultObj.Data.ToString()); +// return info; +// } +// } +// else +// { +// return null; +// } - } +// } - /// <summary> - /// 璇锋眰鏈嶅姟鍣ㄨ幏鍙栧綋鍓嶄綇瀹匰ip璐﹀彿淇℃伅骞跺垵濮嬪寲LinphoneSDK鍜岀櫥褰� - /// </summary> - /// <param name="homeId"></param> - public void GetHDLSipInfoAndInitSDK(HDLCallVideoInfo mHDLCallVideoInfo, bool clearCallInfo = true) - { - try - { - //鍏堟竻绌哄懠鍙拰鐩戣璁惧淇℃伅 - if (clearCallInfo) - { - //InitCallInfo(null);//閫犳垚鎺ユ敹鍛煎彨鏃跺紑閿佸紑閿佸紓甯� - } +// /// <summary> +// /// 璇锋眰鏈嶅姟鍣ㄨ幏鍙栧綋鍓嶄綇瀹匰ip璐﹀彿淇℃伅骞跺垵濮嬪寲LinphoneSDK鍜岀櫥褰� +// /// </summary> +// /// <param name="homeId"></param> +// public void GetHDLSipInfoAndInitSDK(HDLCallVideoInfo mHDLCallVideoInfo, bool clearCallInfo = true) +// { +// try +// { +// //鍏堟竻绌哄懠鍙拰鐩戣璁惧淇℃伅 +// if (clearCallInfo) +// { +// //InitCallInfo(null);//閫犳垚鎺ユ敹鍛煎彨鏃跺紑閿佸紑閿佸紓甯� +// } - HDLSipInfo mHDLSipInfo = GetHDLSipInfo(mHDLCallVideoInfo.HomeId); - if (mHDLSipInfo != null) - { - Application.RunOnMainThread(() => - { - try - { - InitLinphone(); - } - catch (Exception ex) - { - MainPage.Log($"InitLinphone exception : {ex.Message}"); - } - mHDLSipInfo.homeId = mHDLCallVideoInfo.HomeId; - try { - SetAccountAndLogin(mHDLSipInfo, mHDLCallVideoInfo.InterphoneType); - } - catch (Exception ex) - { - MainPage.Log($"SetAccountAndLogin exception : {ex.Message}"); - } - Utlis.WriteLine("CALL 鑾峰彇SIP璐﹀彿鎴愬姛锛�" + mHDLSipInfo.sipAccount); - }); - } - else - { - //Application.RunOnMainThread(() => - //{ - // new Alert("", $"鑾峰彇Sip璐﹀彿淇℃伅澶辫触.", "纭畾").Show(); - //}); - } - } - catch { } +// HDLSipInfo mHDLSipInfo = GetHDLSipInfo(mHDLCallVideoInfo.HomeId); +// if (mHDLSipInfo != null) +// { +// Application.RunOnMainThread(() => +// { +// try +// { +// InitLinphone(); +// } +// catch (Exception ex) +// { +// MainPage.Log($"InitLinphone exception : {ex.Message}"); +// } +// mHDLSipInfo.homeId = mHDLCallVideoInfo.HomeId; +// try { +// SetAccountAndLogin(mHDLSipInfo, mHDLCallVideoInfo.InterphoneType); +// } +// catch (Exception ex) +// { +// MainPage.Log($"SetAccountAndLogin exception : {ex.Message}"); +// } +// Utlis.WriteLine("CALL 鑾峰彇SIP璐﹀彿鎴愬姛锛�" + mHDLSipInfo.sipAccount); +// }); +// } +// else +// { +// //Application.RunOnMainThread(() => +// //{ +// // new Alert("", $"鑾峰彇Sip璐﹀彿淇℃伅澶辫触.", "纭畾").Show(); +// //}); +// } +// } +// catch { } - } - #endregion +// } +// #endregion - #region 鈻� -- 鍔ㄤ綔鍥炶皟鍜屽師鐢熶氦浜掞紝鎻愪氦璁板綍鍒颁簯绔痏______________________________ +// #region 鈻� -- 鍔ㄤ綔鍥炶皟鍜屽師鐢熶氦浜掞紝鎻愪氦璁板綍鍒颁簯绔痏______________________________ - /// <summary> - /// 鍒濆鍖栧懠鍙弬鏁� - /// </summary> - /// <param name="mHDLCallVideoInfo"></param> - /// <param name="mInterphoneType"></param> - void InitCallInfo(HDLCallVideoInfo mHDLCallVideoInfo) - { - this.mHDLCallVideoInfo = mHDLCallVideoInfo; - } +// /// <summary> +// /// 鍒濆鍖栧懠鍙弬鏁� +// /// </summary> +// /// <param name="mHDLCallVideoInfo"></param> +// /// <param name="mInterphoneType"></param> +// void InitCallInfo(HDLCallVideoInfo mHDLCallVideoInfo) +// { +// this.mHDLCallVideoInfo = mHDLCallVideoInfo; +// } - /// <summary> - /// 鍒ゆ柇callId鏄惁涓虹┖ - /// </summary> - /// <returns></returns> - bool CheckmHDLCallVideoInfoIsNullOrEmpty() - { - return (mHDLCallVideoInfo == null || string.IsNullOrEmpty(mHDLCallVideoInfo.CallId)); - } +// /// <summary> +// /// 鍒ゆ柇callId鏄惁涓虹┖ +// /// </summary> +// /// <returns></returns> +// bool CheckmHDLCallVideoInfoIsNullOrEmpty() +// { +// return (mHDLCallVideoInfo == null || string.IsNullOrEmpty(mHDLCallVideoInfo.CallId)); +// } - /// <summary> - /// 鎴浘鎴愬姛 鏆傛椂搴熷純 - /// </summary> - public void ScreenshotSuccessfulAction(byte[] dataBytes) - { - //Utlis.WriteLine("ScreenshotSuccessfulAction"); +// /// <summary> +// /// 鎴浘鎴愬姛 鏆傛椂搴熷純 +// /// </summary> +// public void ScreenshotSuccessfulAction(byte[] dataBytes) +// { +// //Utlis.WriteLine("ScreenshotSuccessfulAction"); - if (CheckmHDLCallVideoInfoIsNullOrEmpty()) return; +// if (CheckmHDLCallVideoInfoIsNullOrEmpty()) return; - new Thread(() => - { - //var imageName = Guid.NewGuid().ToString(); - Dictionary<string, object> dic = new Dictionary<string, object>(); - dic.Add("callId", mHDLCallVideoInfo.CallId); - dic.Add("images", dataBytes); -#if __IOS__ - dic.Add("imagesName", "_IOS.jpg"); -#else - dic.Add("imagesName", "_Android.jpg"); -#endif +// new Thread(() => +// { +// //var imageName = Guid.NewGuid().ToString(); +// Dictionary<string, object> dic = new Dictionary<string, object>(); +// dic.Add("callId", mHDLCallVideoInfo.CallId); +// dic.Add("images", dataBytes); +//#if __IOS__ +// dic.Add("imagesName", "_IOS.jpg"); +//#else +// dic.Add("imagesName", "_Android.jpg"); +//#endif - var requestJson = HttpUtil.GetSignRequestJson(dic); - var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Screenshot, requestJson); - if (revertObj.Code == StateCode.SUCCESS) - { - //Utlis.WriteLine("POST 鎴浘涓婁紶鎴愬姛"); - } - else - { - Utlis.WriteLine("POST 鎴浘涓婁紶澶辫触 code: " + revertObj.Code); - } +// var requestJson = HttpUtil.GetSignRequestJson(dic); +// var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Screenshot, requestJson); +// if (revertObj.Code == StateCode.SUCCESS) +// { +// //Utlis.WriteLine("POST 鎴浘涓婁紶鎴愬姛"); +// } +// else +// { +// Utlis.WriteLine("POST 鎴浘涓婁紶澶辫触 code: " + revertObj.Code); +// } - }) - { IsBackground = false }.Start(); +// }) +// { IsBackground = false }.Start(); - } +// } - //DateTime UnlockDateTime = DateTime.MinValue; - #endregion +// //DateTime UnlockDateTime = DateTime.MinValue; +// #endregion - #region 鈻� -- 鏂版帴鍚拰寮�閿佹帴鍙______________________________ - /// <summary> - /// 鍙瀵硅寮�閿� - /// </summary> - public void HDLUnlockAction() - { - //Utlis.WriteLine("UnlockAction"); +// #region 鈻� -- 鏂版帴鍚拰寮�閿佹帴鍙______________________________ +// /// <summary> +// /// 鍙瀵硅寮�閿� +// /// </summary> +// public void HDLUnlockAction() +// { +// //Utlis.WriteLine("UnlockAction"); - if (mHDLCallVideoInfo == null) return; +// if (mHDLCallVideoInfo == null) return; - new Thread(() => - { - Dictionary<string, object> dic = new Dictionary<string, object>(); - dic.Add("deviceId", mHDLCallVideoInfo.DeviceId);//璁惧id - dic.Add("callId", mHDLCallVideoInfo.CallId);//褰撳墠鍛煎彨id - dic.Add("interphoneType", mHDLCallVideoInfo.InterphoneType);//鍙瀵硅鍘傚绫诲瀷 - dic.Add("homeId", mHDLCallVideoInfo.HomeId);//浣忓畢ID - var requestJson = HttpUtil.GetSignRequestJson(dic); - var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_VideoDevice_OpenDoorbell, requestJson); +// new Thread(() => +// { +// Dictionary<string, object> dic = new Dictionary<string, object>(); +// dic.Add("deviceId", mHDLCallVideoInfo.DeviceId);//璁惧id +// dic.Add("callId", mHDLCallVideoInfo.CallId);//褰撳墠鍛煎彨id +// dic.Add("interphoneType", mHDLCallVideoInfo.InterphoneType);//鍙瀵硅鍘傚绫诲瀷 +// dic.Add("homeId", mHDLCallVideoInfo.HomeId);//浣忓畢ID +// var requestJson = HttpUtil.GetSignRequestJson(dic); +// var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_VideoDevice_OpenDoorbell, requestJson); - Application.RunOnMainThread(() => - { - if(revertObj == null) - { - return; - } +// Application.RunOnMainThread(() => +// { +// if(revertObj == null) +// { +// return; +// } -#if __IOS__ - if (revertObj.Code == StateCode.SUCCESS) - { - //鍜屽師鐢熺洃鎺х晫闈氦浜掋�佸彂閫佸紑閿佹垚鍔熼�氱煡 - NSNotificationCenter.DefaultCenter.PostNotificationName("lcCallDelegateOpenDoorSuccess", null); - } - else - { - Utlis.WriteLine("POST 寮�閿佸け璐� code: " + revertObj.Code); - } -#else - if (revertObj.Code == StateCode.SUCCESS) - { - HDLLinphoneKit.Instance.OnOpenSuccess(); - } - else - { - Utlis.WriteLine("POST 寮�閿佸け璐� code: " + revertObj.Code); - HDLLinphoneKit.Instance.OnOpenError(revertObj.message); - } -#endif +//#if __IOS__ +// if (revertObj.Code == StateCode.SUCCESS) +// { +// //鍜屽師鐢熺洃鎺х晫闈氦浜掋�佸彂閫佸紑閿佹垚鍔熼�氱煡 +// NSNotificationCenter.DefaultCenter.PostNotificationName("lcCallDelegateOpenDoorSuccess", null); +// } +// else +// { +// Utlis.WriteLine("POST 寮�閿佸け璐� code: " + revertObj.Code); +// } +//#else +// if (revertObj.Code == StateCode.SUCCESS) +// { +// HDLLinphoneKit.Instance.OnOpenSuccess(); +// } +// else +// { +// Utlis.WriteLine("POST 寮�閿佸け璐� code: " + revertObj.Code); +// HDLLinphoneKit.Instance.OnOpenError(revertObj.message); +// } +//#endif - }); +// }); - }) - { IsBackground = false }.Start(); - } +// }) +// { IsBackground = false }.Start(); +// } - /// <summary> - /// 鏇存敼閫氳瘽鐘舵�� - /// </summary> - public void HDLUpdateCallStatus(CallStatusType callStatusType, InterphoneType interphoneType, int callDuration = 0) - { +// /// <summary> +// /// 鏇存敼閫氳瘽鐘舵�� +// /// </summary> +// public void HDLUpdateCallStatus(CallStatusType callStatusType, InterphoneType interphoneType, int callDuration = 0) +// { - if (CheckmHDLCallVideoInfoIsNullOrEmpty()) return; +// if (CheckmHDLCallVideoInfoIsNullOrEmpty()) return; - new Thread(() => - { - Dictionary<string, object> dic = new Dictionary<string, object>(); - dic.Add("callId", mHDLCallVideoInfo.CallId);//鍛煎彨id - dic.Add("callStatus", callStatusType.ToString());//鍙敤鍊�:MISSED,RECEIVED,REJECT - dic.Add("interphoneTypeEnum", interphoneType.ToString()); - if (callStatusType == CallStatusType.RECEIVED && callDuration > 0) - { - dic.Add("callDuration", callDuration);//閫氳瘽鏃堕暱锛堢锛� - } +// new Thread(() => +// { +// Dictionary<string, object> dic = new Dictionary<string, object>(); +// dic.Add("callId", mHDLCallVideoInfo.CallId);//鍛煎彨id +// dic.Add("callStatus", callStatusType.ToString());//鍙敤鍊�:MISSED,RECEIVED,REJECT +// dic.Add("interphoneTypeEnum", interphoneType.ToString()); +// if (callStatusType == CallStatusType.RECEIVED && callDuration > 0) +// { +// dic.Add("callDuration", callDuration);//閫氳瘽鏃堕暱锛堢锛� +// } - var requestJson = HttpUtil.GetSignRequestJson(dic); - var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_VideoDevice_UpdateCallStatus, requestJson); - if (revertObj.Code == StateCode.SUCCESS) - { +// var requestJson = HttpUtil.GetSignRequestJson(dic); +// var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_VideoDevice_UpdateCallStatus, requestJson); +// if (revertObj.Code == StateCode.SUCCESS) +// { - } - else - { - Utlis.WriteLine("POST 鏇存柊鐘舵�佸け璐� code: " + revertObj.Code); - } +// } +// else +// { +// Utlis.WriteLine("POST 鏇存柊鐘舵�佸け璐� code: " + revertObj.Code); +// } - }) - { IsBackground = false }.Start(); +// }) +// { IsBackground = false }.Start(); - } - #endregion +// } +// #endregion - #region 鈻� -- 璺宠浆鐩戞帶椤甸潰_______________________________ - /// <summary> - /// 璺宠浆鐩戞帶椤甸潰 - /// </summary> - /// <param name="mESVideoInfo"></param> - public void ShowESVideoMonitor(ESVideoInfo mESVideoInfo,string mInterphoneType) - { - InitLinphone(); - //sip璐﹀彿涓虹┖ - if (string.IsNullOrEmpty(mESVideoInfo.deviceSipAccount)) - { +// #region 鈻� -- 璺宠浆鐩戞帶椤甸潰_______________________________ +// /// <summary> +// /// 璺宠浆鐩戞帶椤甸潰 +// /// </summary> +// /// <param name="mESVideoInfo"></param> +// public void ShowESVideoMonitor(ESVideoInfo mESVideoInfo,string mInterphoneType) +// { +// InitLinphone(); +// //sip璐﹀彿涓虹┖ +// if (string.IsNullOrEmpty(mESVideoInfo.deviceSipAccount)) +// { - HDLCommon.Current.ShowAlert(Language.StringByID(StringId.shebeibucunzai)); - return; - } - HDLCallVideoInfo mHDLCallVideoInfo = new HDLCallVideoInfo(); - mHDLCallVideoInfo.HomeId = mESVideoInfo.HomeId; - mHDLCallVideoInfo.DeviceId = mESVideoInfo.Lc_DeviceId; - mHDLCallVideoInfo.DeviceName = mESVideoInfo.DeviceName; - mHDLCallVideoInfo.InterphoneType = mInterphoneType; - mHDLCallVideoInfo.DeviceSipAccount = mESVideoInfo.deviceSipAccount;//鐩戣涓诲姩鍛煎彨闂ㄥ彛鏈烘椂鐢ㄥ埌 - InitCallInfo(mHDLCallVideoInfo); +// HDLCommon.Current.ShowAlert(Language.StringByID(StringId.shebeibucunzai)); +// return; +// } +// HDLCallVideoInfo mHDLCallVideoInfo = new HDLCallVideoInfo(); +// mHDLCallVideoInfo.HomeId = mESVideoInfo.HomeId; +// mHDLCallVideoInfo.DeviceId = mESVideoInfo.Lc_DeviceId; +// mHDLCallVideoInfo.DeviceName = mESVideoInfo.DeviceName; +// mHDLCallVideoInfo.InterphoneType = mInterphoneType; +// mHDLCallVideoInfo.DeviceSipAccount = mESVideoInfo.deviceSipAccount;//鐩戣涓诲姩鍛煎彨闂ㄥ彛鏈烘椂鐢ㄥ埌 +// InitCallInfo(mHDLCallVideoInfo); -#if __IOS__ +//#if __IOS__ - 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); - } +// 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.鍏堝懠鍙澶� - Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.CallTo(mHDLCallVideoInfo.DeviceSipAccount, true); - //2.璺宠浆鎵撳紑鐩戞帶椤甸潰 - var intent = new Intent(Shared.Application.Activity, typeof(Com.Hdl.Hdllinphonesdk.Activity.HDLLinphoneMonitorActivity)); ; - intent.PutExtra(HDLLinphoneKit.KeyTitleName, mHDLCallVideoInfo.DeviceName);//浼犲叆璁惧鍚嶇О涓烘樉绀烘爣棰� - Shared.Application.Activity.StartActivity(intent); -#endif +//#else +// //1.鍏堝懠鍙澶� +// Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.CallTo(mHDLCallVideoInfo.DeviceSipAccount, true); +// //2.璺宠浆鎵撳紑鐩戞帶椤甸潰 +// var intent = new Intent(Shared.Application.Activity, typeof(Com.Hdl.Hdllinphonesdk.Activity.HDLLinphoneMonitorActivity)); ; +// intent.PutExtra(HDLLinphoneKit.KeyTitleName, mHDLCallVideoInfo.DeviceName);//浼犲叆璁惧鍚嶇О涓烘樉绀烘爣棰� +// Shared.Application.Activity.StartActivity(intent); +//#endif - } - #endregion +// } +// #endregion - #region 鈻� -- 璺宠浆鍛煎彨椤甸潰_______________________________ - /// <summary> - /// 鏀跺埌鎺ㄩ�侊紝鍚庡垽鏂懠鍙綇瀹呮槸鍚︿负褰撳墠浣忓畢锛屼笉鏄殑璇濋噸鏂拌幏鍙朣IP璐﹀彿骞剁櫥褰� - /// </summary> - /// <param name="mESVideoInfo"></param> - public void ShowESVideoIntercom(ESVideoInfo mESVideoInfo,string mInterphoneType) - { - InitLinphone(); +// #region 鈻� -- 璺宠浆鍛煎彨椤甸潰_______________________________ +// /// <summary> +// /// 鏀跺埌鎺ㄩ�侊紝鍚庡垽鏂懠鍙綇瀹呮槸鍚︿负褰撳墠浣忓畢锛屼笉鏄殑璇濋噸鏂拌幏鍙朣IP璐﹀彿骞剁櫥褰� +// /// </summary> +// /// <param name="mESVideoInfo"></param> +// public void ShowESVideoIntercom(ESVideoInfo mESVideoInfo,string mInterphoneType) +// { +// InitLinphone(); - HDLCallVideoInfo mHDLCallVideoInfo = new HDLCallVideoInfo(); - mHDLCallVideoInfo.CallId = mESVideoInfo.callId; - mHDLCallVideoInfo.HomeId = mESVideoInfo.HomeId; - mHDLCallVideoInfo.DeviceId = mESVideoInfo.Lc_DeviceId; - mHDLCallVideoInfo.DeviceName = mESVideoInfo.DeviceName; - mHDLCallVideoInfo.InterphoneType = mInterphoneType; - mHDLCallVideoInfo.DeviceSipAccount = mESVideoInfo.deviceSipAccount; - mHDLCallVideoInfo.spk = mESVideoInfo.spk; - InitCallInfo(mHDLCallVideoInfo); +// HDLCallVideoInfo mHDLCallVideoInfo = new HDLCallVideoInfo(); +// mHDLCallVideoInfo.CallId = mESVideoInfo.callId; +// mHDLCallVideoInfo.HomeId = mESVideoInfo.HomeId; +// mHDLCallVideoInfo.DeviceId = mESVideoInfo.Lc_DeviceId; +// mHDLCallVideoInfo.DeviceName = mESVideoInfo.DeviceName; +// mHDLCallVideoInfo.InterphoneType = mInterphoneType; +// mHDLCallVideoInfo.DeviceSipAccount = mESVideoInfo.deviceSipAccount; +// mHDLCallVideoInfo.spk = mESVideoInfo.spk; +// InitCallInfo(mHDLCallVideoInfo); - //褰撳墠鍛煎彨鏉ョ數鐨勪綇瀹呭拰涔嬪墠娉ㄥ唽鐧诲綍鐨勪綇瀹呬竴鑷寸殑鎯呭喌涓� - if (currentHDLSipInfo != null && currentHDLSipInfo.homeId == mESVideoInfo.HomeId) - { - Utlis.WriteLine("CALL 鏀跺埌鎺ㄩ�� 鎺ㄩ�佷綇瀹呭拰涔嬪墠娉ㄥ唽鐧诲綍鐨勪綇瀹呬竴鑷�"); - CheckCallStateAndGotoPage(); - } - else - { - //娉ㄦ剰锛氫箣鍓嶆病鐧诲綍SIP璐﹀彿鎴栬�呬綇瀹呬笉涓�鑷寸殑鎯呭喌涓嬮渶瑕侀噸鏂拌幏鍙朣IP璐﹀彿 - //鑾峰彇鍛煎彨浣忓畢鐨凷IP璐﹀彿骞剁櫥褰� - Utlis.WriteLine("CALL 鏀跺埌鎺ㄩ�� 鍏朵粬浣忓畢锛岄噸鏂拌幏鍙栧懠鍙綇瀹呯殑SIP璐﹀彿骞剁櫥褰�"); - new Thread(() => - { - GetHDLSipInfoAndInitSDK(mHDLCallVideoInfo, false); - }) - { IsBackground = false }.Start(); +// //褰撳墠鍛煎彨鏉ョ數鐨勪綇瀹呭拰涔嬪墠娉ㄥ唽鐧诲綍鐨勪綇瀹呬竴鑷寸殑鎯呭喌涓� +// if (currentHDLSipInfo != null && currentHDLSipInfo.homeId == mESVideoInfo.HomeId) +// { +// Utlis.WriteLine("CALL 鏀跺埌鎺ㄩ�� 鎺ㄩ�佷綇瀹呭拰涔嬪墠娉ㄥ唽鐧诲綍鐨勪綇瀹呬竴鑷�"); +// CheckCallStateAndGotoPage(); +// } +// else +// { +// //娉ㄦ剰锛氫箣鍓嶆病鐧诲綍SIP璐﹀彿鎴栬�呬綇瀹呬笉涓�鑷寸殑鎯呭喌涓嬮渶瑕侀噸鏂拌幏鍙朣IP璐﹀彿 +// //鑾峰彇鍛煎彨浣忓畢鐨凷IP璐﹀彿骞剁櫥褰� +// Utlis.WriteLine("CALL 鏀跺埌鎺ㄩ�� 鍏朵粬浣忓畢锛岄噸鏂拌幏鍙栧懠鍙綇瀹呯殑SIP璐﹀彿骞剁櫥褰�"); +// new Thread(() => +// { +// GetHDLSipInfoAndInitSDK(mHDLCallVideoInfo, false); +// }) +// { IsBackground = false }.Start(); - // - CheckCallStateAndGotoPage(); +// // +// CheckCallStateAndGotoPage(); - } +// } - } +// } - /// <summary> - /// 妫�娴嬫潵鐢电姸鎬侊紝鍒ゆ柇鏄惁椹笂鎵撳紑鍛煎彨椤甸潰锛屽鏋滆繕娌℃潵鐢靛垯寮�鍚嚎绋嬫娴嬬瓑寰� - /// </summary> - /// <param name="mESVideoInfo"></param> - public void CheckCallStateAndGotoPage() - { - if (mHDLCallVideoInfo.spk == "door.gate") - { -#if __IOS__ - //鑷爺鍙瀵硅 - Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().GotoHDLSRLinphoneIntercomVC(mHDLCallVideoInfo.DeviceName, mHDLCallVideoInfo.DeviceSipAccount); -#else - var intent = new Intent(Shared.Application.Activity, typeof(Com.Hdl.Hdllinphonesdk.Activity.HDLLinphoneReverseCallActivity)); - if (mHDLCallVideoInfo != null) - { - //intent.PutExtra(HDLLinphoneKit.KeyTitleName, mHDLCallVideoInfo.DeviceName); - intent.PutExtra("lpTitleName", mHDLCallVideoInfo.DeviceName); - intent.PutExtra("lpSipAccount", mHDLCallVideoInfo.DeviceSipAccount); - } - Shared.Application.Activity.StartActivity(intent); -#endif - } - else { - //鐙勮�愬厠鍙瀵硅 - //濡傛灉寮�鍚簡鑷姩璺宠浆鏂规锛屽垯鏃犻渶缁х画涓嬮潰澶勭悊銆佹棤闇�鎵嬪姩璺宠浆 - if (IsAutoJumpCallView) return; - //鍏堢粨鏉熸帀涔嬪墠鐨勭嚎绋� - EndCheckIncomingCallThread(); - //妫�娴嬫槸鍚︽潵鐢典簡濡傛灉鏄洿鎺ヨ皟鏁村懠鍙〉闈㈠鏋滀笉鏄垯寮�鍚嚎绋嬬瓑寰呭垽鏂�(Shared.IOS.HDLLinphoneSDK) - if (IsIncomingReceivedCallState()) - { - Utlis.WriteLine("CALL 宸茬粡鏉ョ數浜嗐�傘�傘�傛墦寮�鍛煎彨椤甸潰"); - GoToHDLLinphoneIntercomActivity(); - } - else - { - //濡傛灉杩樻病鏉ョ數 寮�鍚嚎绋嬫娴� - StartCheckIncomingCallThread(); - } - } +// /// <summary> +// /// 妫�娴嬫潵鐢电姸鎬侊紝鍒ゆ柇鏄惁椹笂鎵撳紑鍛煎彨椤甸潰锛屽鏋滆繕娌℃潵鐢靛垯寮�鍚嚎绋嬫娴嬬瓑寰� +// /// </summary> +// /// <param name="mESVideoInfo"></param> +// public void CheckCallStateAndGotoPage() +// { +// if (mHDLCallVideoInfo.spk == "door.gate") +// { +//#if __IOS__ +// //鑷爺鍙瀵硅 +// Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().GotoHDLSRLinphoneIntercomVC(mHDLCallVideoInfo.DeviceName, mHDLCallVideoInfo.DeviceSipAccount); +//#else +// var intent = new Intent(Shared.Application.Activity, typeof(Com.Hdl.Hdllinphonesdk.Activity.HDLLinphoneReverseCallActivity)); +// if (mHDLCallVideoInfo != null) +// { +// //intent.PutExtra(HDLLinphoneKit.KeyTitleName, mHDLCallVideoInfo.DeviceName); +// intent.PutExtra("lpTitleName", mHDLCallVideoInfo.DeviceName); +// intent.PutExtra("lpSipAccount", mHDLCallVideoInfo.DeviceSipAccount); +// } +// Shared.Application.Activity.StartActivity(intent); +//#endif +// } +// else { +// //鐙勮�愬厠鍙瀵硅 +// //濡傛灉寮�鍚簡鑷姩璺宠浆鏂规锛屽垯鏃犻渶缁х画涓嬮潰澶勭悊銆佹棤闇�鎵嬪姩璺宠浆 +// if (IsAutoJumpCallView) return; +// //鍏堢粨鏉熸帀涔嬪墠鐨勭嚎绋� +// EndCheckIncomingCallThread(); +// //妫�娴嬫槸鍚︽潵鐢典簡濡傛灉鏄洿鎺ヨ皟鏁村懠鍙〉闈㈠鏋滀笉鏄垯寮�鍚嚎绋嬬瓑寰呭垽鏂�(Shared.IOS.HDLLinphoneSDK) +// if (IsIncomingReceivedCallState()) +// { +// Utlis.WriteLine("CALL 宸茬粡鏉ョ數浜嗐�傘�傘�傛墦寮�鍛煎彨椤甸潰"); +// GoToHDLLinphoneIntercomActivity(); +// } +// else +// { +// //濡傛灉杩樻病鏉ョ數 寮�鍚嚎绋嬫娴� +// StartCheckIncomingCallThread(); +// } +// } - } +// } - /// <summary> - /// 鏄惁鏉ョ數鐘舵��(Shared.IOS.HDLLinphoneSDK) - /// </summary> - /// <returns></returns> - bool IsIncomingReceivedCallState() - { -#if __IOS__ - return Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().IsIncomingReceivedCallState; -#else - return HDLLinphoneKit.Instance.IsIncomingReceivedCallState; -#endif - } +// /// <summary> +// /// 鏄惁鏉ョ數鐘舵��(Shared.IOS.HDLLinphoneSDK) +// /// </summary> +// /// <returns></returns> +// bool IsIncomingReceivedCallState() +// { +//#if __IOS__ +// return Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().IsIncomingReceivedCallState; +//#else +// return HDLLinphoneKit.Instance.IsIncomingReceivedCallState; +//#endif +// } - /// <summary> - /// 璺宠浆鎵撳紑鍘熺敓鐨勫懠鍙〉闈� - /// </summary> - void GoToHDLLinphoneIntercomActivity() { +// /// <summary> +// /// 璺宠浆鎵撳紑鍘熺敓鐨勫懠鍙〉闈� +// /// </summary> +// void GoToHDLLinphoneIntercomActivity() { -#if __IOS__ +//#if __IOS__ - Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().GotoHDLLinphoneIntercomVC(mHDLCallVideoInfo.DeviceName); +// Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().GotoHDLLinphoneIntercomVC(mHDLCallVideoInfo.DeviceName); -#else - var intent = new Intent(Shared.Application.Activity, typeof(Com.Hdl.Hdllinphonesdk.Activity.HDLLinphoneIntercomActivity)); - if (mHDLCallVideoInfo != null) - { - //intent.PutExtra(HDLLinphoneKit.KeyTitleName, mHDLCallVideoInfo.DeviceName); - intent.PutExtra(HDLLinphoneKit.KeyTitleName, mHDLCallVideoInfo.CallId); - } - Shared.Application.Activity.StartActivity(intent); -#endif +//#else +// var intent = new Intent(Shared.Application.Activity, typeof(Com.Hdl.Hdllinphonesdk.Activity.HDLLinphoneIntercomActivity)); +// if (mHDLCallVideoInfo != null) +// { +// //intent.PutExtra(HDLLinphoneKit.KeyTitleName, mHDLCallVideoInfo.DeviceName); +// intent.PutExtra(HDLLinphoneKit.KeyTitleName, mHDLCallVideoInfo.CallId); +// } +// Shared.Application.Activity.StartActivity(intent); +//#endif - } +// } - /// <summary> - /// 妫�娴嬫潵鐢电嚎绋� - /// </summary> - Thread checkIncomingCallThread = null; - /// <summary> - /// 妫�娴嬬嚎绋嬫寔缁椂闂� - /// </summary> - const int MAX_THREAD_TIME = 30; - /// <summary> - /// 绾跨▼缁撴潫 - /// </summary> - int threadTime = MAX_THREAD_TIME; - /// <summary> - /// 寮�鍚娴嬫潵鐢电嚎绋� - /// </summary> - void StartCheckIncomingCallThread() - { - try - { - Utlis.WriteLine("CALL 杩樻病鏉ョ數锛屽紑鍚嚎绋�"); - threadTime = MAX_THREAD_TIME; - //缁撴潫涔嬪墠鐨勭嚎绋� - EndCheckIncomingCallThread(); - //鏂板缓绾跨▼ - checkIncomingCallThread = new Thread(() => - { - try - { - //15S鍚庤嚜鍔ㄧ粨鏉熺嚎绋� - while (threadTime > 0) - { - threadTime--; - Utlis.WriteLine("CALL 妫�娴嬩腑...." + threadTime); - Thread.Sleep(1000); - //鏉ョ數浜嗭紝璺宠浆鍛煎彨椤甸潰(Shared.IOS.HDLLinphoneSDK) - if (IsIncomingReceivedCallState()) - { - Utlis.WriteLine("CALL 鏉ョ數浜嗐�傘�傘�傛墦寮�鍛煎彨椤甸潰"); - threadTime = 0;//璺冲嚭寰幆锛屽叧闂嚎绋� - Application.RunOnMainThread(() => - { - GoToHDLLinphoneIntercomActivity(); - }); +// /// <summary> +// /// 妫�娴嬫潵鐢电嚎绋� +// /// </summary> +// Thread checkIncomingCallThread = null; +// /// <summary> +// /// 妫�娴嬬嚎绋嬫寔缁椂闂� +// /// </summary> +// const int MAX_THREAD_TIME = 30; +// /// <summary> +// /// 绾跨▼缁撴潫 +// /// </summary> +// int threadTime = MAX_THREAD_TIME; +// /// <summary> +// /// 寮�鍚娴嬫潵鐢电嚎绋� +// /// </summary> +// void StartCheckIncomingCallThread() +// { +// try +// { +// Utlis.WriteLine("CALL 杩樻病鏉ョ數锛屽紑鍚嚎绋�"); +// threadTime = MAX_THREAD_TIME; +// //缁撴潫涔嬪墠鐨勭嚎绋� +// EndCheckIncomingCallThread(); +// //鏂板缓绾跨▼ +// checkIncomingCallThread = new Thread(() => +// { +// try +// { +// //15S鍚庤嚜鍔ㄧ粨鏉熺嚎绋� +// while (threadTime > 0) +// { +// threadTime--; +// Utlis.WriteLine("CALL 妫�娴嬩腑...." + threadTime); +// Thread.Sleep(1000); +// //鏉ョ數浜嗭紝璺宠浆鍛煎彨椤甸潰(Shared.IOS.HDLLinphoneSDK) +// if (IsIncomingReceivedCallState()) +// { +// Utlis.WriteLine("CALL 鏉ョ數浜嗐�傘�傘�傛墦寮�鍛煎彨椤甸潰"); +// threadTime = 0;//璺冲嚭寰幆锛屽叧闂嚎绋� +// Application.RunOnMainThread(() => +// { +// GoToHDLLinphoneIntercomActivity(); +// }); - } - } +// } +// } - } - catch { } - }); - //寮�鍚嚎绋� - checkIncomingCallThread.Start(); - } - catch { } - } +// } +// catch { } +// }); +// //寮�鍚嚎绋� +// checkIncomingCallThread.Start(); +// } +// catch { } +// } - /// <summary> - /// 缁撴潫绾跨▼ - /// </summary> - void EndCheckIncomingCallThread() - { - if (checkIncomingCallThread != null) - { - try - { - checkIncomingCallThread.Interrupt(); - } - catch { +// /// <summary> +// /// 缁撴潫绾跨▼ +// /// </summary> +// void EndCheckIncomingCallThread() +// { +// if (checkIncomingCallThread != null) +// { +// try +// { +// checkIncomingCallThread.Interrupt(); +// } +// catch { - } +// } - checkIncomingCallThread = null; - Utlis.WriteLine("CALL 鍏堢粨鏉熺嚎绋�"); - } - } +// checkIncomingCallThread = null; +// Utlis.WriteLine("CALL 鍏堢粨鏉熺嚎绋�"); +// } +// } - /// <summary> - /// 鍒ゆ柇绾跨▼鏄惁鍚姩浜� - /// </summary> - /// <returns></returns> - public bool CheckIncomingCallThreadIsNull() - { - return checkIncomingCallThread == null || checkIncomingCallThread.ThreadState != ThreadState.Running; - } +// /// <summary> +// /// 鍒ゆ柇绾跨▼鏄惁鍚姩浜� +// /// </summary> +// /// <returns></returns> +// public bool CheckIncomingCallThreadIsNull() +// { +// return checkIncomingCallThread == null || checkIncomingCallThread.ThreadState != ThreadState.Running; +// } - #endregion +// #endregion - #region 鈻� -- Android鐩稿叧鎿嶄綔_______________________________ +// #region 鈻� -- Android鐩稿叧鎿嶄綔_______________________________ -#if __Android__ +//#if __Android__ - /// <summary> - /// 鎺ュ惉銆佹寕鏂�佸紑閿佺瓑鍔ㄤ綔鐩戝惉澶勭悊 - /// </summary> - private class HDLLinphoneCallListener : Java.Lang.Object, Com.Hdl.Hdllinphonesdk.Callback.IOnHDLLinphoneCallListener - { - [Weak] HDLLinphone hdlLinphone; +// /// <summary> +// /// 鎺ュ惉銆佹寕鏂�佸紑閿佺瓑鍔ㄤ綔鐩戝惉澶勭悊 +// /// </summary> +// private class HDLLinphoneCallListener : Java.Lang.Object, Com.Hdl.Hdllinphonesdk.Callback.IOnHDLLinphoneCallListener +// { +// [Weak] HDLLinphone hdlLinphone; - public HDLLinphoneCallListener(HDLLinphone mHDLLinphone) - { - hdlLinphone = mHDLLinphone; - } +// public HDLLinphoneCallListener(HDLLinphone mHDLLinphone) +// { +// hdlLinphone = mHDLLinphone; +// } - //showToast - void showToast(string text) - { - Toast.MakeText(Application.Activity, text, ToastLength.Short).Show(); - } - /// <summary> - /// 鎺ュ惉浜嬩欢 - /// </summary> - public void OnAnswerAction() - { - //showToast("鎺ュ惉"); - hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL); - } - /// <summary> - /// 鎸傛柇浜嬩欢 - /// </summary> - /// <param name="callDuration"></param> - public void OnHangUpAction(int callDuration) - { +// //showToast +// void showToast(string text) +// { +// Toast.MakeText(Application.Activity, text, ToastLength.Short).Show(); +// } +// /// <summary> +// /// 鎺ュ惉浜嬩欢 +// /// </summary> +// public void OnAnswerAction() +// { +// //showToast("鎺ュ惉"); +// hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL); +// } +// /// <summary> +// /// 鎸傛柇浜嬩欢 +// /// </summary> +// /// <param name="callDuration"></param> +// public void OnHangUpAction(int callDuration) +// { - //showToast("鎸傛柇 閫氳瘽鏃堕暱锛�" + callDuration); - hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL, callDuration); - } +// //showToast("鎸傛柇 閫氳瘽鏃堕暱锛�" + callDuration); +// hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL, callDuration); +// } - /// <summary> - /// 鎷掓帴浜嬩欢 - /// </summary> - public void OnRejectCallAction() - { - //showToast("鎷掓帴"); - hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL); - } +// /// <summary> +// /// 鎷掓帴浜嬩欢 +// /// </summary> +// public void OnRejectCallAction() +// { +// //showToast("鎷掓帴"); +// hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL); +// } - /// <summary> - /// 鎴浘鎴愬姛浜嬩欢 - /// </summary> - /// <param name="p0"></param> - public void OnScreenshotSuccessfulAction(Bitmap imgBitmap) - { - //showToast("鎴浘鎴愬姛"); - } +// /// <summary> +// /// 鎴浘鎴愬姛浜嬩欢 +// /// </summary> +// /// <param name="p0"></param> +// public void OnScreenshotSuccessfulAction(Bitmap imgBitmap) +// { +// //showToast("鎴浘鎴愬姛"); +// } - /// <summary> - /// 寮�閿佷簨浠� - /// </summary> - public void OnUnlockAction() - { - hdlLinphone.HDLUnlockAction(); - } +// /// <summary> +// /// 寮�閿佷簨浠� +// /// </summary> +// public void OnUnlockAction() +// { +// hdlLinphone.HDLUnlockAction(); +// } - /// <summary> - /// 鏉ョ數浜嬩欢 - /// </summary> - /// <param name="userName"></param> - public void OnIncomingCall(string userName) - { - Utlis.WriteLine("OnIncomingCall :" + userName); - } - } +// /// <summary> +// /// 鏉ョ數浜嬩欢 +// /// </summary> +// /// <param name="userName"></param> +// public void OnIncomingCall(string userName) +// { +// Utlis.WriteLine("OnIncomingCall :" + userName); +// } +// } - /// <summary> - /// 璁剧疆鍘熺敓鐨凩istener鐩戝惉 - /// </summary> - void setOnHDLLinphoneCallListener() - { - HDLLinphoneKit.Instance.OnHDLLinphoneCallListener = new HDLLinphoneCallListener(this); - } +// /// <summary> +// /// 璁剧疆鍘熺敓鐨凩istener鐩戝惉 +// /// </summary> +// void setOnHDLLinphoneCallListener() +// { +// HDLLinphoneKit.Instance.OnHDLLinphoneCallListener = new HDLLinphoneCallListener(this); +// } - /// <summary> - /// 娓呮閫氱煡鏍忔墍鏈夐�氱煡 - /// </summary> - void CancelAllNotification() - { - NotificationManager nMgr = (NotificationManager)Application.Activity.GetSystemService(Context.NotificationService); - nMgr.CancelAll(); - } +// /// <summary> +// /// 娓呮閫氱煡鏍忔墍鏈夐�氱煡 +// /// </summary> +// void CancelAllNotification() +// { +// NotificationManager nMgr = (NotificationManager)Application.Activity.GetSystemService(Context.NotificationService); +// nMgr.CancelAll(); +// } -#endif - #endregion +//#endif +// #endregion - #region 鈻� -- iOS鐩稿叧鎿嶄綔_______________________________ +// #region 鈻� -- iOS鐩稿叧鎿嶄綔_______________________________ -#if __IOS__ +//#if __IOS__ - #region OnHDLLinphoneCallDelegate - /// <summary> - /// - /// </summary> - OnHDLLinphoneCallDelegate mOnHDLLinphoneCallDelegate; +// #region OnHDLLinphoneCallDelegate +// /// <summary> +// /// +// /// </summary> +// OnHDLLinphoneCallDelegate mOnHDLLinphoneCallDelegate; - /// <summary> - /// - /// </summary> - public class OnHDLLinphoneCallDelegate : HDLLinphoneCallDelegate - { - [Weak] HDLLinphone hdlLinphone; +// /// <summary> +// /// +// /// </summary> +// public class OnHDLLinphoneCallDelegate : HDLLinphoneCallDelegate +// { +// [Weak] HDLLinphone hdlLinphone; - public OnHDLLinphoneCallDelegate(HDLLinphone mHDLLinphone) - { - this.hdlLinphone = mHDLLinphone; - } +// public OnHDLLinphoneCallDelegate(HDLLinphone mHDLLinphone) +// { +// this.hdlLinphone = mHDLLinphone; +// } - /// <summary> - /// 鎺ュ惉 - /// </summary> - public override void OnAnswerAction() - { - hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL); - } +// /// <summary> +// /// 鎺ュ惉 +// /// </summary> +// public override void OnAnswerAction() +// { +// hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL); +// } - /// <summary> - /// 鎸傛柇 - /// </summary> - /// <param name="callDuration"></param> - public override void OnHangUpAction(int callDuration) - { - hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL, callDuration); - } +// /// <summary> +// /// 鎸傛柇 +// /// </summary> +// /// <param name="callDuration"></param> +// public override void OnHangUpAction(int callDuration) +// { +// hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL, callDuration); +// } - /// <summary> - /// 鎷掓帴 - /// </summary> - public override void OnRejectCallAction() - { - hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL); - } +// /// <summary> +// /// 鎷掓帴 +// /// </summary> +// public override void OnRejectCallAction() +// { +// hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL); +// } - /// <summary> - /// 鎴浘鎴愬姛 - /// </summary> - /// <param name = "image" ></ param > - public void OnScreenshotSuccessfulAction(UIImage image) - { - //NSData imageData = UIImagePNGRepresentation(image); UIImage - NSData imageData = image.AsPNG(); - byte[] dataBytes = new byte[imageData.Length]; - System.Runtime.InteropServices.Marshal.Copy(imageData.Bytes, dataBytes, 0, Convert.ToInt32(imageData.Length)); - //image.g - //hdlLinphone.ScreenshotSuccessfulAction(dataBytes); - } +// /// <summary> +// /// 鎴浘鎴愬姛 +// /// </summary> +// /// <param name = "image" ></ param > +// public void OnScreenshotSuccessfulAction(UIImage image) +// { +// //NSData imageData = UIImagePNGRepresentation(image); UIImage +// NSData imageData = image.AsPNG(); +// byte[] dataBytes = new byte[imageData.Length]; +// System.Runtime.InteropServices.Marshal.Copy(imageData.Bytes, dataBytes, 0, Convert.ToInt32(imageData.Length)); +// //image.g +// //hdlLinphone.ScreenshotSuccessfulAction(dataBytes); +// } - /// <summary> - /// 寮�閿佹垚鍔� - /// </summary> - public override void OnUnlockAction() - { - hdlLinphone.HDLUnlockAction(); - } +// /// <summary> +// /// 寮�閿佹垚鍔� +// /// </summary> +// public override void OnUnlockAction() +// { +// hdlLinphone.HDLUnlockAction(); +// } - /// <summary> - /// 鏉ョ數涓�... - /// </summary> - public override void OnIncomingCall(string userName) - { - Utlis.WriteLine("OnIncomingCall :" + userName); - } +// /// <summary> +// /// 鏉ョ數涓�... +// /// </summary> +// public override void OnIncomingCall(string userName) +// { +// Utlis.WriteLine("OnIncomingCall :" + userName); +// } - } +// } - #endregion -#endif +// #endregion +//#endif - #endregion +// #endregion - } +// } - /// <summary> - /// SIP鍙瀵硅鍙傛暟 - /// </summary> - public class HDLCallVideoInfo - { - /// <summary> - /// 璁惧搴忓垪鍙凤紝閫氳蹇呰瀛楁 - /// </summary> - public string DeviceId = string.Empty; - /// <summary> - /// 璁惧鍚嶇О - /// </summary> - public string DeviceName = string.Empty; - /// <summary> - /// 璁惧Sip璐﹀彿 - /// </summary> - public string DeviceSipAccount = string.Empty; - /// <summary> - /// 鍛煎彨璁板綍Id - /// </summary> - public string CallId = string.Empty; - /// <summary> - /// 浣忓畢Id - /// </summary> - public string HomeId = string.Empty; - /// <summary> - /// 绫诲瀷 - /// </summary> - public string InterphoneType; - /// <summary> - /// spk - /// </summary> - public string spk=""; +// /// <summary> +// /// SIP鍙瀵硅鍙傛暟 +// /// </summary> +// public class HDLCallVideoInfo +// { +// /// <summary> +// /// 璁惧搴忓垪鍙凤紝閫氳蹇呰瀛楁 +// /// </summary> +// public string DeviceId = string.Empty; +// /// <summary> +// /// 璁惧鍚嶇О +// /// </summary> +// public string DeviceName = string.Empty; +// /// <summary> +// /// 璁惧Sip璐﹀彿 +// /// </summary> +// public string DeviceSipAccount = string.Empty; +// /// <summary> +// /// 鍛煎彨璁板綍Id +// /// </summary> +// public string CallId = string.Empty; +// /// <summary> +// /// 浣忓畢Id +// /// </summary> +// public string HomeId = string.Empty; +// /// <summary> +// /// 绫诲瀷 +// /// </summary> +// public string InterphoneType; +// /// <summary> +// /// spk +// /// </summary> +// public string spk=""; - } +// } - /// <summary> - /// SIP璐﹀彿鐩稿叧淇℃伅 - /// </summary> - public class HDLSipInfo - { - /// <summary> - /// Sip鏈嶅姟鍣� - /// </summary> - public string proxy { get; set; } - /// <summary> - /// 璁惧鍩� - /// </summary> - public string realm { get; set; } - /// <summary> - /// sip璐﹀彿 - /// </summary> - public string sipAccount { get; set; } - /// <summary> - /// sipPasswd sip瀵嗙爜 - /// </summary> - public string sipPasswd { get; set; } - /// <summary> - /// 浣忓畢ID - /// </summary> - public string homeId; - } +// /// <summary> +// /// SIP璐﹀彿鐩稿叧淇℃伅 +// /// </summary> +// public class HDLSipInfo +// { +// /// <summary> +// /// Sip鏈嶅姟鍣� +// /// </summary> +// public string proxy { get; set; } +// /// <summary> +// /// 璁惧鍩� +// /// </summary> +// public string realm { get; set; } +// /// <summary> +// /// sip璐﹀彿 +// /// </summary> +// public string sipAccount { get; set; } +// /// <summary> +// /// sipPasswd sip瀵嗙爜 +// /// </summary> +// public string sipPasswd { get; set; } +// /// <summary> +// /// 浣忓畢ID +// /// </summary> +// public string homeId; +// } -} +//} -- Gitblit v1.8.0