Commit 48896474e6405f69f5033970538809dbc112a356

Authored by panlinlin
1 parent 6968839f

检查设备是否存在, 不存在则不回复心跳

src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
@@ -315,12 +315,16 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor { @@ -315,12 +315,16 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
315 try { 315 try {
316 Element rootElement = getRootElement(evt); 316 Element rootElement = getRootElement(evt);
317 String deviceId = XmlUtil.getText(rootElement, "DeviceID"); 317 String deviceId = XmlUtil.getText(rootElement, "DeviceID");
318 - // 回复200 OK  
319 - responseAck(evt);  
320 - if (offLineDetector.isOnline(deviceId)) {  
321 - publisher.onlineEventPublish(deviceId, VideoManagerConstants.EVENT_ONLINE_KEEPLIVE);  
322 - } else { 318 + // 检查设备是否存在, 不存在则不回复
  319 + if (storager.exists(deviceId)) {
  320 + // 回复200 OK
  321 + responseAck(evt);
  322 + if (offLineDetector.isOnline(deviceId)) {
  323 + publisher.onlineEventPublish(deviceId, VideoManagerConstants.EVENT_ONLINE_KEEPLIVE);
  324 + } else {
  325 + }
323 } 326 }
  327 +
324 } catch (ParseException | SipException | InvalidArgumentException | DocumentException e) { 328 } catch (ParseException | SipException | InvalidArgumentException | DocumentException e) {
325 e.printStackTrace(); 329 e.printStackTrace();
326 } 330 }