From 674ab18c028eb8d9520f4b4f77f282aad303439f Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期五, 12 一月 2024 15:03:11 +0800 Subject: [PATCH] 修复rtp暂停检查调用失败 --- src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java | 14 ++++++++++---- src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java | 3 +++ 2 files changed, 13 insertions(+), 4 deletions(-) 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 faaefab..fb2623d 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 @@ ":" + (stream != null ? stream : "*") + ":*"; List<Object> 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 9012c29..8f0a23f 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 @@ -955,8 +955,11 @@ } // zlm 鏆傚仠RTP瓒呮椂妫�鏌� // 浣跨敤zlm涓殑娴両D - 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) { throw new ServiceException("鏆傚仠RTP鎺ユ敹澶辫触"); } @@ -980,8 +983,11 @@ } // zlm 鏆傚仠RTP瓒呮椂妫�鏌� // 浣跨敤zlm涓殑娴両D - 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) { throw new ServiceException("缁х画RTP鎺ユ敹澶辫触"); } -- Gitblit v1.8.0