648540858
2023-07-01 c551164c89f70e664b498c3a09e615928261e01a
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java
@@ -57,6 +57,9 @@
    private IRedisCatchStorage redisCatchStorage;
   @Autowired
    private UserSetting userSetting;
   @Autowired
   private IVideoManagerStorage storager;
   @Autowired
@@ -73,9 +76,6 @@
   @Autowired
   private RedisGbPlayMsgListener redisGbPlayMsgListener;
   @Autowired
   private UserSetting userSetting;
   @Autowired
   private IPlayService playService;
@@ -102,13 +102,15 @@
         }
         String isUdp = sendRtpItem.isTcp() ? "0" : "1";
         MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId());
         logger.info("收到ACK,rtp/{}开始向上级推流, 目标={}:{},SSRC={}, RTCP={}", sendRtpItem.getStream(),
         logger.info("收到ACK,rtp/{}开始级推流, 目标={}:{},SSRC={}, RTCP={}", sendRtpItem.getStream(),
               sendRtpItem.getIp(), sendRtpItem.getPort(), sendRtpItem.getSsrc(), sendRtpItem.isRtcp());
         Map<String, Object> param = new HashMap<>(12);
         param.put("vhost","__defaultVhost__");
         param.put("app",sendRtpItem.getApp());
         param.put("stream",sendRtpItem.getStream());
         param.put("ssrc", sendRtpItem.getSsrc());
         param.put("dst_url",sendRtpItem.getIp());
         param.put("dst_port", sendRtpItem.getPort());
         param.put("src_port", sendRtpItem.getLocalPort());
         param.put("pt", sendRtpItem.getPt());
         param.put("use_ps", sendRtpItem.isUsePs() ? "1" : "0");
@@ -131,16 +133,12 @@
            // 如果是非严格模式,需要关闭端口占用
            JSONObject startSendRtpStreamResult = null;
            if (sendRtpItem.getLocalPort() != 0) {
               HookSubscribeForRtpServerTimeout hookSubscribeForRtpServerTimeout = HookSubscribeFactory.on_rtp_server_timeout(sendRtpItem.getSsrc(), null, mediaInfo.getId());
               hookSubscribe.removeSubscribe(hookSubscribeForRtpServerTimeout);
               if (zlmrtpServerFactory.releasePort(mediaInfo, sendRtpItem.getSsrc())) {
                  if (sendRtpItem.isTcpActive()) {
                     startSendRtpStreamResult = zlmrtpServerFactory.startSendRtpPassive(mediaInfo, param);
                  }else {
                     param.put("dst_url", sendRtpItem.getIp());
                     param.put("dst_port", sendRtpItem.getPort());
                     startSendRtpStreamResult = zlmrtpServerFactory.startSendRtpStream(mediaInfo, param);
                  }
               if (sendRtpItem.isTcpActive()) {
                  startSendRtpStreamResult = zlmrtpServerFactory.startSendRtpPassive(mediaInfo, param);
               }else {
                  param.put("dst_url", sendRtpItem.getIp());
                  param.put("dst_port", sendRtpItem.getPort());
                  startSendRtpStreamResult = zlmrtpServerFactory.startSendRtpStream(mediaInfo, param);
               }
            }else {
               if (sendRtpItem.isTcpActive()) {