diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java index 220d9ee5..004b1ec8 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java @@ -102,7 +102,7 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In log.info("收到ACK,rtp/{} TCP主动方式后续处理", sendRtpItem.getStream()); return; } - MediaServer mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId()); + MediaServer mediaServer = mediaServerService.getOne(sendRtpItem.getMediaServerId()); log.info("收到ACK,rtp/{}开始向上级推流, 目标={}:{},SSRC={}, 协议:{}", sendRtpItem.getStream(), sendRtpItem.getIp(), @@ -121,11 +121,11 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In } } else { try { - if (mediaInfo != null) { + if (mediaServer != null) { if (sendRtpItem.isTcpActive()) { - mediaServerService.startSendRtpPassive(mediaInfo,sendRtpItem, null); + mediaServerService.startSendRtpPassive(mediaServer,sendRtpItem, null); } else { - mediaServerService.startSendRtp(mediaInfo, sendRtpItem); + mediaServerService.startSendRtp(mediaServer, sendRtpItem); } }else { // mediaInfo 在集群的其他wvp里 @@ -148,15 +148,15 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In if (!device.isBroadcastPushAfterAck()) { return; } - if (mediaInfo == null) { + if (mediaServer == null) { log.warn("[收到ACK]:来自{},目标为({})的推流信息为找到流体服务[{}]信息",fromUserId, toUserId, sendRtpItem.getMediaServerId()); return; } try { if (sendRtpItem.isTcpActive()) { - mediaServerService.startSendRtpPassive(mediaInfo, sendRtpItem, null); + mediaServerService.startSendRtpPassive(mediaServer, sendRtpItem, null); } else { - mediaServerService.startSendRtp(mediaInfo, sendRtpItem); + mediaServerService.startSendRtp(mediaServer, sendRtpItem); } }catch (ControllerException e) { log.error("RTP推流失败: {}", e.getMessage()); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java index f562ab20..813c6255 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java @@ -125,9 +125,11 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In }else { MediaServer mediaServer = mediaServerService.getOne(sendRtpItem.getMediaServerId()); sendRtpServerService.deleteByCallId(callIdHeader.getCallId()); - mediaServerService.stopSendRtp(mediaServer, sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getSsrc()); - if (userSetting.getUseCustomSsrcForParentInvite()) { - mediaServerService.releaseSsrc(mediaServer.getId(), sendRtpItem.getSsrc()); + if (mediaServer != null) { + mediaServerService.stopSendRtp(mediaServer, sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getSsrc()); + if (userSetting.getUseCustomSsrcForParentInvite()) { + mediaServerService.releaseSsrc(mediaServer.getId(), sendRtpItem.getSsrc()); + } } } }else { diff --git a/src/main/java/com/genersoft/iot/vmp/media/service/impl/MediaServerServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/media/service/impl/MediaServerServiceImpl.java index 2b306496..c1b560fe 100755 --- a/src/main/java/com/genersoft/iot/vmp/media/service/impl/MediaServerServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/media/service/impl/MediaServerServiceImpl.java @@ -795,6 +795,7 @@ public class MediaServerServiceImpl implements IMediaServerService { } streamInfoResult.setIp(addr); + streamInfoResult.setServerId(mediaInfo.getServerId()); streamInfoResult.setMediaServer(mediaServer); String callIdParam = ObjectUtils.isEmpty(callId)?"":"?callId=" + callId; streamInfoResult.setRtmp(addr, mediaServer.getRtmpPort(),mediaServer.getRtmpSSlPort(), app, stream, callIdParam); diff --git a/src/main/java/com/genersoft/iot/vmp/streamPush/service/impl/StreamPushPlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/streamPush/service/impl/StreamPushPlayServiceImpl.java index 7183dc30..7268b28c 100644 --- a/src/main/java/com/genersoft/iot/vmp/streamPush/service/impl/StreamPushPlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/streamPush/service/impl/StreamPushPlayServiceImpl.java @@ -61,7 +61,7 @@ public class StreamPushPlayServiceImpl implements IStreamPushPlayService { callId = streamAuthorityInfo.getCallId(); } callback.run(ErrorCode.SUCCESS.getCode(), ErrorCode.SUCCESS.getMsg(), mediaServerService.getStreamInfoByAppAndStream(mediaInfo.getMediaServer(), - streamPush.getApp(), streamPush.getStream(), null, callId)); + streamPush.getApp(), streamPush.getStream(), mediaInfo, callId)); return; } Assert.isTrue(streamPush.isStartOfflinePush(), "通道未推流");