648540858
2024-03-19 1e0b73b9392592aa36e66cf63c359ab6331f8448
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java
old mode 100644 new mode 100755
@@ -13,6 +13,7 @@
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
import com.genersoft.iot.vmp.media.service.IMediaServerService;
import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory;
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
import com.genersoft.iot.vmp.service.*;
@@ -128,6 +129,9 @@
         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 +171,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 +218,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());