panlinlin
2021-05-08 e48fa711a3664bece9b3e58840a75fe7c05bc47c
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
@@ -770,14 +770,19 @@
      try {
         Element rootElement = getRootElement(evt);
         String deviceId = XmlUtil.getText(rootElement, "DeviceID");
         // 检查设备是否存在, 不存在则不回复
         if (storager.exists(deviceId)) {
         Device device = storager.queryVideoDevice(deviceId);
         // 检查设备是否存在并在线, 不存在则不回复
         if (device != null && device.getOnline() == 1) {
            // 回复200 OK
            responseAck(evt);
            if (offLineDetector.isOnline(deviceId)) {
               publisher.onlineEventPublish(deviceId, VideoManagerConstants.EVENT_ONLINE_KEEPLIVE);
            } else {
            }
         }else {
            logger.warn("收到[ "+deviceId+" ]心跳信息, 但是设备" + (device == null? "不存在":"离线") + ", 回复401");
            Response response = getMessageFactory().createResponse(Response.UNAUTHORIZED, evt.getRequest());
            getServerTransaction(evt).sendResponse(response);
         }
      } catch (ParseException | SipException | InvalidArgumentException | DocumentException e) {
         e.printStackTrace();