panlinlin
2021-05-08 e48fa711a3664bece9b3e58840a75fe7c05bc47c
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
@@ -114,13 +114,13 @@
         String cmd = XmlUtil.getText(rootElement, "CmdType");
         if (MESSAGE_KEEP_ALIVE.equals(cmd)) {
            logger.info("接收到KeepAlive消息");
            logger.debug("接收到KeepAlive消息");
            processMessageKeepAlive(evt);
         } else if (MESSAGE_CONFIG_DOWNLOAD.equals(cmd)) {
            logger.info("接收到ConfigDownload消息");
            logger.debug("接收到ConfigDownload消息");
            processMessageConfigDownload(evt);
         } else if (MESSAGE_CATALOG.equals(cmd)) {
            logger.info("接收到Catalog消息");
            logger.debug("接收到Catalog消息");
            processMessageCatalogList(evt);
         } else if (MESSAGE_DEVICE_INFO.equals(cmd)) {
            // DeviceInfo消息处理
@@ -129,31 +129,31 @@
            // DeviceStatus消息处理
            processMessageDeviceStatus(evt);
         } else if (MESSAGE_DEVICE_CONTROL.equals(cmd)) {
            logger.info("接收到DeviceControl消息");
            logger.debug("接收到DeviceControl消息");
            processMessageDeviceControl(evt);
         } else if (MESSAGE_DEVICE_CONFIG.equals(cmd)) {
            logger.info("接收到DeviceConfig消息");
            processMessageDeviceConfig(evt);
         } else if (MESSAGE_ALARM.equals(cmd)) {
            logger.info("接收到Alarm消息");
            logger.debug("接收到Alarm消息");
            processMessageAlarm(evt);
         } else if (MESSAGE_RECORD_INFO.equals(cmd)) {
            logger.info("接收到RecordInfo消息");
            logger.debug("接收到RecordInfo消息");
            processMessageRecordInfo(evt);
         }else if (MESSAGE_MEDIA_STATUS.equals(cmd)) {
            logger.info("接收到MediaStatus消息");
            logger.debug("接收到MediaStatus消息");
            processMessageMediaStatus(evt);
         } else if (MESSAGE_MOBILE_POSITION.equals(cmd)) {
            logger.info("接收到MobilePosition消息");
            logger.debug("接收到MobilePosition消息");
            processMessageMobilePosition(evt);
         } else if (MESSAGE_PRESET_QUERY.equals(cmd)) {
            logger.info("接收到PresetQuery消息");
            logger.debug("接收到PresetQuery消息");
            processMessagePresetQuery(evt);
         } else if (MESSAGE_BROADCAST.equals(cmd)) {
            // Broadcast消息处理
            processMessageBroadcast(evt);
         } else {
            logger.info("接收到消息:" + cmd);
            logger.debug("接收到消息:" + cmd);
            responseAck(evt);
         }
      } catch (DocumentException | SipException |InvalidArgumentException | ParseException e) {
@@ -467,7 +467,7 @@
               cmderFroPlatform.deviceInfoResponse(parentPlatform, sn, fromHeader.getTag());
            }
         } else {
            logger.info("接收到DeviceInfo应答消息");
            logger.debug("接收到DeviceInfo应答消息");
            Device device = storager.queryVideoDevice(deviceId);
            if (device == null) {
               return;
@@ -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();
@@ -922,7 +927,7 @@
            StreamInfo streamInfo = redisCatchStorage.queryPlaybackByDevice(deviceId, "*");
            if (streamInfo != null) {
               redisCatchStorage.stopPlayback(streamInfo);
               cmder.streamByeCmd(streamInfo.getStreamId());
               cmder.streamByeCmd(streamInfo.getDeviceID(), streamInfo.getChannelId());
            }
         }
      } catch (ParseException | SipException | InvalidArgumentException | DocumentException e) {