648540858
2023-08-16 985082d33930868c3cc1723f28fd9aaae9013a8f
src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java
old mode 100644 new mode 100755
@@ -91,10 +91,10 @@
        if (isSend != null && isSend && callId == null) {
            throw new ControllerException(ErrorCode.ERROR100.getCode(),"isSend为true时,CallID不能为空");
        }
        int ssrcInt = 0;
        long ssrcInt = 0;
        if (ssrc != null) {
            try {
                ssrcInt = Integer.parseInt(ssrc);
                ssrcInt = Long.parseLong(ssrc);
            }catch (NumberFormatException e) {
                throw new ControllerException(ErrorCode.ERROR100.getCode(),"ssrc格式错误");
            }
@@ -139,13 +139,14 @@
        redisTemplate.opsForValue().set(receiveKey, otherRtpSendInfo);
        if (isSend != null && isSend) {
            // 预创建发流信息
            int portForVideo = sendRtpPortManager.getNextPort(mediaServerItem.getId());
            int portForAudio = sendRtpPortManager.getNextPort(mediaServerItem.getId());
            // 将信息写入redis中,以备后用
            redisTemplate.opsForValue().set(key, otherRtpSendInfo, 300, TimeUnit.SECONDS);
            int portForVideo = sendRtpPortManager.getNextPort(mediaServerItem);
            int portForAudio = sendRtpPortManager.getNextPort(mediaServerItem);
            otherRtpSendInfo.setSendLocalIp(mediaServerItem.getSdpIp());
            otherRtpSendInfo.setSendLocalPortForVideo(portForVideo);
            otherRtpSendInfo.setSendLocalPortForAudio(portForAudio);
            // 将信息写入redis中,以备后用
            redisTemplate.opsForValue().set(key, otherRtpSendInfo, 300, TimeUnit.SECONDS);
            logger.info("[第三方服务对接->开启收流和获取发流信息] 结果,callId->{}, {}", callId, otherRtpSendInfo);
        }
        // 将信息写入redis中,以备后用