Ejemplo n.º 1
0
        /// <summary>
        /// 目录订阅通知消息处理
        /// </summary>
        /// <param name="localEP">本地终结点</param>
        /// <param name="remoteEP">远程终结点</param>
        /// <param name="request">sip请求</param>
        private void NotifyHandle(SIPEndPoint localEP, SIPEndPoint remoteEP, SIPRequest request)
        {
            SendResponse(localEP, remoteEP, request);
            //目录推送通知
            NotifyCatalog notify = NotifyCatalog.Instance.Read(request.Body);

            if (notify != null && notify.CmdType == CommandType.Catalog)  //设备目录
            {
                if (OnNotifyCatalogReceived != null)
                {
                    OnNotifyCatalogReceived(notify);
                }
            }

            //语音广播通知
            //移动设备位置数据通知
            VoiceBroadcastNotify voice = VoiceBroadcastNotify.Instance.Read(request.Body);

            if (voice != null && voice.CmdType == CommandType.Broadcast)    //语音广播
            {
                if (OnVoiceBroadcaseReceived != null)
                {
                    OnVoiceBroadcaseReceived(voice);
                }
            }
        }
Ejemplo n.º 2
0
 internal void OnNotifyCatalogReceived(NotifyCatalog notify)
 {
     if (notify.DeviceList == null)
     {
         return;
     }
     new Action(() =>
     {
         foreach (var item in notify.DeviceList.Items)
         {
         }
     }).BeginInvoke(null, null);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Notify Catalog Received
 /// </summary>
 /// <param name="obj"></param>
 private void _sipCoreMessageService_OnNotifyCatalogReceived(NotifyCatalog obj)
 {
     if (obj.DeviceList == null)
     {
         return;
     }
     new Action(() =>
     {
         foreach (var item in obj.DeviceList.Items)
         {
             NotifyCatalogItem.Enqueue(item);
         }
     }).BeginInvoke(null, null);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 目录通知回调
 /// </summary>
 /// <param name="obj"></param>
 void MessageCore_OnNotifyCatalogReceived(NotifyCatalog notify)
 {
     if (notify.DeviceList == null)
     {
         return;
     }
     new Action(() =>
     {
         foreach (var item in notify.DeviceList.Items)
         {
             var listview = lvDev.Items.Cast <ListViewItem>();
             foreach (var view in listview)
             {
                 if (item.DeviceID == view.ImageKey)
                 {
                     view.ForeColor        = Color.Red;
                     view.SubItems[2].Text = "OFF";
                 }
             }
         }
     }).BeginInvoke(null, null);
 }