Exemple #1
0
        /// <summary>
        /// 设备注册事件
        /// </summary>
        /// <param name="sipTransaction"></param>
        /// <param name="sIPAccount"></param>
        private void _sipRegistrarCore_RPCDmsRegisterReceived(SIPTransaction sipTransaction, GB28181.SIPSorcery.SIP.App.SIPAccount sIPAccount)
        {
            try
            {
                _SIPAccount = sIPAccount;
                string deviceid = sipTransaction.TransactionRequestFrom.URI.User;

                //GB SIPTransactions Dictionary
                GBSIPTransactions.Remove(deviceid);
                GBSIPTransactions.Add(deviceid, sipTransaction);

                //Device Catalog Query
                _sipCoreMessageService.DeviceCatalogQuery(deviceid);

                ////query device info from db
                //string edit = IsDeviceExisted(deviceid) ? "updated" : "added";

                ////Device Dms Register
                //DeviceDmsRegister(sipTransaction,"gb");

                ////Device Edit Event
                //DeviceEditEvent(deviceid, edit);
            }
            catch (Exception ex)
            {
                logger.Error("_sipRegistrarCore_RPCDmsRegisterReceived Exception: " + ex.Message);
            }
        }
Exemple #2
0
 //private void _sipCoreMessageService_OnCatalogReceived(Catalog obj)
 //{
 //    if (!Catalogs.ContainsKey(obj.DeviceID))
 //    {
 //        Catalogs.Add(obj.DeviceID, obj);
 //    }
 //    else
 //    {
 //        Catalogs.Remove(obj.DeviceID);
 //        Catalogs.Add(obj.DeviceID, obj);
 //    }
 //}
 /// <summary>
 /// Device Catalog Query
 /// </summary>
 /// <param name="deviceId"></param>
 public void DeviceCatalogQuery(string deviceId)
 {
     Logger.Logger.Debug("Device Catalog Query started.");
     _sipCoreMessageService.DeviceCatalogQuery(deviceId, out string _);
 }