648540858
2024-03-21 912c83dfd31283631e4f7a1bd88d387baa6a16d4
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java
old mode 100644 new mode 100755
@@ -115,7 +115,7 @@
      // 收流端发送的停止
      if (sendRtpItem != null){
         logger.info("[收到bye] 来自{},停止通道:{}, 类型: {}", sendRtpItem.getPlatformId(), sendRtpItem.getChannelId(), sendRtpItem.getPlayType());
         logger.info("[收到bye] 来自{},停止通道:{}, 类型: {}, callId: {}", sendRtpItem.getPlatformId(), sendRtpItem.getChannelId(), sendRtpItem.getPlayType(), callIdHeader.getCallId());
         String streamId = sendRtpItem.getStream();
         Map<String, Object> param = new HashMap<>();
@@ -123,11 +123,14 @@
         param.put("app",sendRtpItem.getApp());
         param.put("stream",streamId);
         param.put("ssrc",sendRtpItem.getSsrc());
         logger.info("[收到bye] 停止推流:{}", streamId);
         logger.info("[收到bye] 停止推流:{}, 媒体节点: {}", streamId, sendRtpItem.getMediaServerId());
         MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId());
         redisCatchStorage.deleteSendRTPServer(sendRtpItem.getPlatformId(), sendRtpItem.getChannelId(),
               callIdHeader.getCallId(), null);
         zlmServerFactory.stopSendRtpStream(mediaInfo, param);
         if (userSetting.getUseCustomSsrcForParentInvite()) {
            mediaServerService.releaseSsrc(mediaInfo.getId(), sendRtpItem.getSsrc());
         }
         if (sendRtpItem.getPlayType().equals(InviteStreamType.PUSH)) {
            ParentPlatform platform = platformService.queryPlatformByServerGBId(sendRtpItem.getPlatformId());
            if (platform != null) {
@@ -167,14 +170,12 @@
         }
      }
      // 发流端发送的停止
      SsrcTransaction ssrcTransaction = streamSession.getSsrcTransaction(null, null, callIdHeader.getCallId(), null);
      if (ssrcTransaction == null ) {
         logger.info("[收到bye] 但是无法获取推流信息和发流信息,忽略此请求");
         logger.info(request.toString());
         return;
      }
         // 可能是设备发送的停止
         SsrcTransaction ssrcTransaction = streamSession.getSsrcTransactionByCallId(callIdHeader.getCallId());
         if (ssrcTransaction == null) {
            return;
         }
         logger.info("[收到bye] 来自设备:{}, 通道已停止推流: {}", ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId());
      ParentPlatform platform = platformService.queryPlatformByServerGBId(ssrcTransaction.getDeviceId());
      if (platform != null ) {
@@ -216,7 +217,7 @@
         if (mediaServerItem != null) {
            mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcTransaction.getSsrc());
         }
         streamSession.remove(device.getDeviceId(), channel.getChannelId(), ssrcTransaction.getStream());
         streamSession.removeByCallId(device.getDeviceId(), channel.getChannelId(), ssrcTransaction.getCallId());
         if (ssrcTransaction.getType() == InviteSessionType.BROADCAST) {
            // 查找来源的对讲设备,发送停止
            Device sourceDevice = storager.queryVideoDeviceByPlatformIdAndChannelId(ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId());