修复推流关联平台的bug

This commit is contained in:
648540858 2022-03-15 16:58:50 +08:00
parent 0dfce85d2f
commit d21a00418e
4 changed files with 12 additions and 13 deletions

View File

@ -670,6 +670,7 @@ public class SIPCommander implements ISIPCommander {
try { try {
SsrcTransaction ssrcTransaction = streamSession.getSsrcTransaction(deviceId, channelId, null, stream); SsrcTransaction ssrcTransaction = streamSession.getSsrcTransaction(deviceId, channelId, null, stream);
ClientTransaction transaction = streamSession.getTransactionByStream(deviceId, channelId, stream); ClientTransaction transaction = streamSession.getTransactionByStream(deviceId, channelId, stream);
if (transaction == null) { if (transaction == null) {
logger.warn("[ {} -> {}]停止视频流的时候发现事务已丢失", deviceId, channelId); logger.warn("[ {} -> {}]停止视频流的时候发现事务已丢失", deviceId, channelId);
SipSubscribe.EventResult<Object> eventResult = new SipSubscribe.EventResult<>(); SipSubscribe.EventResult<Object> eventResult = new SipSubscribe.EventResult<>();
@ -685,7 +686,12 @@ public class SIPCommander implements ISIPCommander {
if (stream == null) return; if (stream == null) return;
dialog = streamSession.getDialogByStream(deviceId, channelId, stream); dialog = streamSession.getDialogByStream(deviceId, channelId, stream);
} }
if (ssrcTransaction != null) {
MediaServerItem mediaServerItem = mediaServerService.getOne(ssrcTransaction.getMediaServerId());
mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcTransaction.getSsrc());
mediaServerService.closeRTPServer(deviceId, channelId, ssrcTransaction.getStream());
streamSession.remove(deviceId, channelId, ssrcTransaction.getStream());
}
if (dialog == null) { if (dialog == null) {
logger.warn("[ {} -> {}]停止视频流的时候发现对话已丢失", deviceId, channelId); logger.warn("[ {} -> {}]停止视频流的时候发现对话已丢失", deviceId, channelId);
@ -730,12 +736,6 @@ public class SIPCommander implements ISIPCommander {
dialog.sendRequest(clientTransaction); dialog.sendRequest(clientTransaction);
if (ssrcTransaction != null) {
MediaServerItem mediaServerItem = mediaServerService.getOne(ssrcTransaction.getMediaServerId());
mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcTransaction.getSsrc());
mediaServerService.closeRTPServer(deviceId, channelId, ssrcTransaction.getStream());
streamSession.remove(deviceId, channelId, ssrcTransaction.getStream());
}
} catch (SipException | ParseException e) { } catch (SipException | ParseException e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -95,7 +95,7 @@ public class ZLMRTPServerFactory {
if (openRtpServerResultJson.getInteger("code") == 0) { if (openRtpServerResultJson.getInteger("code") == 0) {
result= openRtpServerResultJson.getInteger("port"); result= openRtpServerResultJson.getInteger("port");
}else { }else {
logger.error("创建RTP Server 失败 {}: " + openRtpServerResultJson.getString("msg"), param.get("port")); logger.error("创建RTP Server 失败 {}: ", openRtpServerResultJson.getString("msg"));
} }
}else { }else {
// 检查ZLM状态 // 检查ZLM状态

View File

@ -885,12 +885,11 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
List<ParentPlatform> parentPlatforms = parentPlatformMapper.selectAllAhareAllLiveStream(); List<ParentPlatform> parentPlatforms = parentPlatformMapper.selectAllAhareAllLiveStream();
if (parentPlatforms.size() > 0) { if (parentPlatforms.size() > 0) {
for (ParentPlatform parentPlatform : parentPlatforms) { for (ParentPlatform parentPlatform : parentPlatforms) {
streamPushItem.setCatalogId(parentPlatform.getCatalogId()); StreamProxyItem streamProxyItems = platformGbStreamMapper.selectOne(streamPushItem.getApp(), streamPushItem.getStream(),
streamPushItem.setPlatformId(parentPlatform.getServerGBId());
String stream = streamPushItem.getStream();
StreamProxyItem streamProxyItems = platformGbStreamMapper.selectOne(streamPushItem.getApp(), stream,
parentPlatform.getServerGBId()); parentPlatform.getServerGBId());
if (streamProxyItems == null) { if (streamProxyItems == null) {
streamPushItem.setCatalogId(parentPlatform.getCatalogId());
streamPushItem.setPlatformId(parentPlatform.getServerGBId());
platformGbStreamMapper.add(streamPushItem); platformGbStreamMapper.add(streamPushItem);
eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), streamPushItem, CatalogEvent.ADD); eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), streamPushItem, CatalogEvent.ADD);
} }

View File

@ -174,7 +174,7 @@ export default {
page: that.currentPage, page: that.currentPage,
count: that.count, count: that.count,
query: that.searchSrt, query: that.searchSrt,
pushing: that.online, pushing: that.pushing,
platformId: that.platformId, platformId: that.platformId,
catalogId: that.catalogId, catalogId: that.catalogId,
mediaServerId: that.mediaServerId mediaServerId: that.mediaServerId