diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java index faaefab6b..fb2623d57 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java @@ -116,6 +116,9 @@ public class InviteStreamServiceImpl implements IInviteStreamService { ":" + (stream != null ? stream : "*") + ":*"; List scanResult = RedisUtil.scan(redisTemplate, key); + if (scanResult.isEmpty()) { + return null; + } if (scanResult.size() != 1) { logger.warn("[获取InviteInfo] 发现 key: {}存在多条", key); } diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java index 7acd77f2e..b771b780a 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java @@ -982,8 +982,11 @@ public class PlayServiceImpl implements IPlayService { } // zlm 暂停RTP超时检查 // 使用zlm中的流ID - String ssrc = Long.toHexString(Long.parseLong(ssrcTransaction.getSsrc())).toUpperCase(); - JSONObject jsonObject = zlmresTfulUtils.pauseRtpCheck(mediaServerItem, ssrc); + String streamKey = inviteInfo.getStream(); + if (!mediaServerItem.isRtpEnable()) { + streamKey = Long.toHexString(Long.parseLong(inviteInfo.getSsrcInfo().getSsrc())).toUpperCase(); + } + JSONObject jsonObject = zlmresTfulUtils.pauseRtpCheck(mediaServerItem, streamKey); if (jsonObject == null || jsonObject.getInteger("code") != 0) { logger.warn("[暂停流] 暂停RTP接收失败: {}", jsonObject ); throw new ServiceException("暂停RTP接收失败"); @@ -1009,8 +1012,11 @@ public class PlayServiceImpl implements IPlayService { // zlm 暂停RTP超时检查 // 使用zlm中的流ID - String ssrc = Long.toHexString(Long.parseLong(ssrcTransaction.getSsrc())).toUpperCase(); - JSONObject jsonObject = zlmresTfulUtils.resumeRtpCheck(mediaServerItem, ssrc); + String streamKey = inviteInfo.getStream(); + if (!mediaServerItem.isRtpEnable()) { + streamKey = Long.toHexString(Long.parseLong(inviteInfo.getSsrcInfo().getSsrc())).toUpperCase(); + } + JSONObject jsonObject = zlmresTfulUtils.resumeRtpCheck(mediaServerItem, streamKey); if (jsonObject == null || jsonObject.getInteger("code") != 0) { logger.info("[暂停RTP超时检查] 失败:" + jsonObject); throw new ServiceException("继续RTP接收失败");