| | |
| | | import javax.sip.message.Response; |
| | | import java.text.ParseException; |
| | | import java.time.Instant; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Random; |
| | | import java.util.Vector; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * SIP命令类型: INVITE请求 |
| | |
| | | sendRtpItem.setOnlyAudio(false); |
| | | sendRtpItem.setStatus(0); |
| | | sendRtpItem.setSessionName(sessionName); |
| | | |
| | | // 清理可能存在的缓存避免用到旧的数据 |
| | | List<SendRtpItem> sendRtpItemList = redisCatchStorage.querySendRTPServer(platform.getServerGBId(), channelId, gbStream.getStream()); |
| | | if (!sendRtpItemList.isEmpty()) { |
| | | for (SendRtpItem rtpItem : sendRtpItemList) { |
| | | redisCatchStorage.deleteSendRTPServer(rtpItem); |
| | | } |
| | | } |
| | | if ("push".equals(gbStream.getStreamType())) { |
| | | sendRtpItem.setPlayType(InviteStreamType.PUSH); |
| | | if (streamPushItem != null) { |
| | |
| | | redisRpcService.waitePushStreamOnline(sendRtpItem, (sendRtpItemFromRedis) -> { |
| | | dynamicTask.stop(sendRtpItem.getCallId()); |
| | | if (sendRtpItemFromRedis.getServerId().equals(userSetting.getServerId())) { |
| | | |
| | | logger.info("[级联点播] 等待的推流在本平台上线 {}/{}", sendRtpItem.getApp(), sendRtpItem.getStream()); |
| | | int localPort = sendRtpPortManager.getNextPort(mediaServerItem); |
| | | if (localPort == 0) { |
| | | logger.warn("上级点时创建sendRTPItem失败,可能是服务器端口资源不足"); |
| | |
| | | * 来自其他wvp的推流 |
| | | */ |
| | | private void otherWvpPushStream(SendRtpItem sendRtpItem, SIPRequest request, ParentPlatform platform) { |
| | | logger.info("[级联点播]直播流来自其他平台,发送redis消息"); |
| | | logger.info("[级联点播] 来自其他wvp的推流 {}/{}", sendRtpItem.getApp(), sendRtpItem.getStream()); |
| | | sendRtpItem = redisRpcService.getSendRtpItem(sendRtpItem); |
| | | // 写入redis, 超时时回复 |
| | | sendRtpItem.setStatus(1); |