648540858
2023-02-22 100252a253263321873e79d43dff94e19defe353
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java
@@ -98,6 +98,16 @@
      if (sendRtpItem != null){
         logger.info("[收到bye] {}/{}", sendRtpItem.getPlatformId(), sendRtpItem.getChannelId());
         String streamId = sendRtpItem.getStreamId();
         MediaServerItem mediaServerItem = mediaServerService.getOne(sendRtpItem.getMediaServerId());
         if (mediaServerItem == null) {
            return;
         }
         Boolean ready = zlmrtpServerFactory.isStreamReady(mediaServerItem, sendRtpItem.getApp(), streamId);
         if (!ready) {
            logger.info("[收到bye] 发现流{}/{}已经结束,不需处理", sendRtpItem.getApp(), sendRtpItem.getStreamId());
            return;
         }
         Map<String, Object> param = new HashMap<>();
         param.put("vhost","__defaultVhost__");
         param.put("app",sendRtpItem.getApp());
@@ -107,11 +117,12 @@
         MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId());
         redisCatchStorage.deleteSendRTPServer(sendRtpItem.getPlatformId(), sendRtpItem.getChannelId(), callIdHeader.getCallId(), null);
         zlmrtpServerFactory.stopSendRtpStream(mediaInfo, param);
         int totalReaderCount = zlmrtpServerFactory.totalReaderCount(mediaInfo, sendRtpItem.getApp(), streamId);
         if (totalReaderCount <= 0) {
            logger.info("[收到bye] {} 无其它观看者,通知设备停止推流", streamId);
            if (sendRtpItem.getPlayType().equals(InviteStreamType.PLAY)) {
               Device device = deviceService.queryDevice(sendRtpItem.getDeviceId());
               Device device = deviceService.getDevice(sendRtpItem.getDeviceId());
               if (device == null) {
                  logger.info("[收到bye] {} 通知设备停止推流时未找到设备信息", streamId);
               }
@@ -131,6 +142,7 @@
               redisCatchStorage.sendStreamPushRequestedMsg(messageForPushChannel);
            }
         }
         playService.stopAudioBroadcast(sendRtpItem.getDeviceId(), sendRtpItem.getChannelId());
      }