Commit 674ab18c028eb8d9520f4b4f77f282aad303439f

Authored by 648540858
1 parent e5a9dd24

修复rtp暂停检查调用失败

src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java
... ... @@ -116,6 +116,9 @@ public class InviteStreamServiceImpl implements IInviteStreamService {
116 116 ":" + (stream != null ? stream : "*")
117 117 + ":*";
118 118 List<Object> scanResult = RedisUtil.scan(redisTemplate, key);
  119 + if (scanResult.isEmpty()) {
  120 + return null;
  121 + }
119 122 if (scanResult.size() != 1) {
120 123 logger.warn("[获取InviteInfo] 发现 key: {}存在多条", key);
121 124 }
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
... ... @@ -955,8 +955,11 @@ public class PlayServiceImpl implements IPlayService {
955 955 }
956 956 // zlm 暂停RTP超时检查
957 957 // 使用zlm中的流ID
958   - String ssrc = Long.toHexString(Long.parseLong(ssrcTransaction.getSsrc())).toUpperCase();
959   - JSONObject jsonObject = zlmresTfulUtils.pauseRtpCheck(mediaServerItem, ssrc);
  958 + String streamKey = inviteInfo.getStream();
  959 + if (!mediaServerItem.isRtpEnable()) {
  960 + streamKey = Long.toHexString(Long.parseLong(inviteInfo.getSsrcInfo().getSsrc())).toUpperCase();
  961 + }
  962 + JSONObject jsonObject = zlmresTfulUtils.pauseRtpCheck(mediaServerItem, streamKey);
960 963 if (jsonObject == null || jsonObject.getInteger("code") != 0) {
961 964 throw new ServiceException("暂停RTP接收失败");
962 965 }
... ... @@ -980,8 +983,11 @@ public class PlayServiceImpl implements IPlayService {
980 983 }
981 984 // zlm 暂停RTP超时检查
982 985 // 使用zlm中的流ID
983   - String ssrc = Long.toHexString(Long.parseLong(ssrcTransaction.getSsrc())).toUpperCase();
984   - JSONObject jsonObject = zlmresTfulUtils.resumeRtpCheck(mediaServerItem, ssrc);
  986 + String streamKey = inviteInfo.getStream();
  987 + if (!mediaServerItem.isRtpEnable()) {
  988 + streamKey = Long.toHexString(Long.parseLong(inviteInfo.getSsrcInfo().getSsrc())).toUpperCase();
  989 + }
  990 + JSONObject jsonObject = zlmresTfulUtils.resumeRtpCheck(mediaServerItem, streamKey);
985 991 if (jsonObject == null || jsonObject.getInteger("code") != 0) {
986 992 throw new ServiceException("继续RTP接收失败");
987 993 }
... ...