From a43a98e1855c4e29ee9991c0dd608dbae273fb6f Mon Sep 17 00:00:00 2001 From: Li Keqing Date: Thu, 19 Dec 2024 09:24:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=9A=84=20MediaStatus=20=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transmit/cmd/impl/SIPCommanderForPlatform.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java index c0c15d0b..0050d446 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java @@ -7,6 +7,7 @@ import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; import com.genersoft.iot.vmp.gb28181.SipLayer; import com.genersoft.iot.vmp.gb28181.bean.*; +import com.genersoft.iot.vmp.gb28181.dao.CommonGBChannelMapper; import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; import com.genersoft.iot.vmp.gb28181.session.SipInviteSessionManager; import com.genersoft.iot.vmp.gb28181.transmit.SIPSender; @@ -84,6 +85,9 @@ public class SIPCommanderForPlatform implements ISIPCommanderForPlatform { @Autowired private GitUtil gitUtil; + @Autowired + private CommonGBChannelMapper commonGBChannelMapper; + @Override public void register(Platform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException { register(parentPlatform, null, null, errorEvent, okEvent, true); @@ -604,6 +608,11 @@ public class SIPCommanderForPlatform implements ISIPCommanderForPlatform { return; } + CommonGBChannel channel = commonGBChannelMapper.queryById(sendRtpItem.getChannelId()); + + if (channel == null) { + return; + } String characterSet = parentPlatform.getCharacterSet(); StringBuffer mediaStatusXml = new StringBuffer(200); @@ -611,7 +620,7 @@ public class SIPCommanderForPlatform implements ISIPCommanderForPlatform { .append("\r\n") .append("MediaStatus\r\n") .append("" + (int)((Math.random()*9+1)*100000) + "\r\n") - .append("" + sendRtpItem.getChannelId() + "\r\n") + .append("" + channel.getGbDeviceId() + "\r\n") .append("121\r\n") .append("\r\n"); From f265bc9d59d35a20367af0d2f8fc060554963dc2 Mon Sep 17 00:00:00 2001 From: Li Keqing Date: Thu, 19 Dec 2024 15:18:28 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E5=BD=95=E5=83=8F=E9=A1=B5=E9=9D=A2=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/src/components/GBRecordDetail.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_src/src/components/GBRecordDetail.vue b/web_src/src/components/GBRecordDetail.vue index 4d58d7a8..288bfe19 100755 --- a/web_src/src/components/GBRecordDetail.vue +++ b/web_src/src/components/GBRecordDetail.vue @@ -58,8 +58,8 @@ - - + + 倍速 From 4757cbd34e7e34f1358d94dc2fda518e630f550b Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Thu, 19 Dec 2024 23:14:45 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=B0=83=E6=95=B4MediaStatus=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cmd/ISIPCommanderForPlatform.java | 2 +- .../cmd/impl/SIPCommanderForPlatform.java | 18 +++---------- .../cmd/MediaStatusNotifyMessageHandler.java | 27 +++++++++---------- 3 files changed, 17 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommanderForPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommanderForPlatform.java index f83f0e0f..6a80dd3a 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommanderForPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommanderForPlatform.java @@ -140,7 +140,7 @@ public interface ISIPCommanderForPlatform { * @param sendRtpItem * @return */ - void sendMediaStatusNotify(Platform platform, SendRtpInfo sendRtpItem) throws SipException, InvalidArgumentException, ParseException; + void sendMediaStatusNotify(Platform platform, SendRtpInfo sendRtpItem, CommonGBChannel channel) throws SipException, InvalidArgumentException, ParseException; void streamByeCmd(Platform platform, SendRtpInfo sendRtpItem, CommonGBChannel channel) throws SipException, InvalidArgumentException, ParseException; diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java index 0050d446..2dbfdf19 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java @@ -60,9 +60,6 @@ public class SIPCommanderForPlatform implements ISIPCommanderForPlatform { @Autowired private IMediaServerService mediaServerService; - @Autowired - private SipSubscribe sipSubscribe; - @Autowired private SipLayer sipLayer; @@ -85,9 +82,6 @@ public class SIPCommanderForPlatform implements ISIPCommanderForPlatform { @Autowired private GitUtil gitUtil; - @Autowired - private CommonGBChannelMapper commonGBChannelMapper; - @Override public void register(Platform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException { register(parentPlatform, null, null, errorEvent, okEvent, true); @@ -603,14 +597,8 @@ public class SIPCommanderForPlatform implements ISIPCommanderForPlatform { } @Override - public void sendMediaStatusNotify(Platform parentPlatform, SendRtpInfo sendRtpItem) throws SipException, InvalidArgumentException, ParseException { - if (sendRtpItem == null || parentPlatform == null) { - return; - } - - CommonGBChannel channel = commonGBChannelMapper.queryById(sendRtpItem.getChannelId()); - - if (channel == null) { + public void sendMediaStatusNotify(Platform parentPlatform, SendRtpInfo sendRtpInfo, CommonGBChannel channel) throws SipException, InvalidArgumentException, ParseException { + if (channel == null || parentPlatform == null) { return; } @@ -625,7 +613,7 @@ public class SIPCommanderForPlatform implements ISIPCommanderForPlatform { .append("\r\n"); SIPRequest messageRequest = (SIPRequest)headerProviderPlatformProvider.createMessageRequest(parentPlatform, mediaStatusXml.toString(), - sendRtpItem); + sendRtpInfo); sipSender.transmitRequest(parentPlatform.getDeviceIp(),messageRequest); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MediaStatusNotifyMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MediaStatusNotifyMessageHandler.java index ba248e26..6b368b72 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MediaStatusNotifyMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MediaStatusNotifyMessageHandler.java @@ -2,14 +2,8 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.notify import com.genersoft.iot.vmp.common.InviteInfo; import com.genersoft.iot.vmp.common.InviteSessionType; -import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.Platform; -import com.genersoft.iot.vmp.gb28181.bean.SendRtpInfo; -import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction; -import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService; -import com.genersoft.iot.vmp.gb28181.service.IInviteStreamService; -import com.genersoft.iot.vmp.gb28181.service.IPlatformService; -import com.genersoft.iot.vmp.gb28181.service.IPlayService; +import com.genersoft.iot.vmp.gb28181.bean.*; +import com.genersoft.iot.vmp.gb28181.service.*; import com.genersoft.iot.vmp.gb28181.session.SipInviteSessionManager; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderForPlatform; @@ -56,7 +50,7 @@ public class MediaStatusNotifyMessageHandler extends SIPRequestProcessorParent i private SIPCommanderForPlatform sipCommanderFroPlatform; @Autowired - private IRedisCatchStorage redisCatchStorage; + private IPlatformChannelService platformChannelService; @Autowired private IPlatformService platformService; @@ -108,15 +102,20 @@ public class MediaStatusNotifyMessageHandler extends SIPRequestProcessorParent i Hook hook = Hook.getInstance(HookType.on_media_arrival, "rtp", ssrcTransaction.getStream(), ssrcTransaction.getMediaServerId()); subscribe.removeSubscribe(hook); // 如果级联播放,需要给上级发送此通知 TODO 多个上级同时观看一个下级 可能存在停错的问题,需要将点播CallId进行上下级绑定 - SendRtpInfo sendRtpItem = sendRtpServerService.queryByChannelId(ssrcTransaction.getChannelId(), ssrcTransaction.getPlatformId()); - if (sendRtpItem != null) { - Platform parentPlatform = platformService.queryPlatformByServerGBId(sendRtpItem.getTargetId()); + SendRtpInfo sendRtpInfo = sendRtpServerService.queryByChannelId(ssrcTransaction.getChannelId(), ssrcTransaction.getPlatformId()); + if (sendRtpInfo != null) { + Platform parentPlatform = platformService.queryPlatformByServerGBId(sendRtpInfo.getTargetId()); if (parentPlatform == null) { - log.warn("[级联消息发送]:发送MediaStatus发现上级平台{}不存在", sendRtpItem.getTargetId()); + log.warn("[级联消息发送]:发送MediaStatus发现上级平台{}不存在", sendRtpInfo.getTargetId()); + return; + } + CommonGBChannel channel = platformChannelService.queryChannelByPlatformIdAndChannelId(parentPlatform.getId(), sendRtpInfo.getChannelId()); + if (channel == null) { + log.warn("[级联消息发送]:发送MediaStatus发现通道{}不存在", sendRtpInfo.getChannelId()); return; } try { - sipCommanderFroPlatform.sendMediaStatusNotify(parentPlatform, sendRtpItem); + sipCommanderFroPlatform.sendMediaStatusNotify(parentPlatform, sendRtpInfo, channel); } catch (SipException | InvalidArgumentException | ParseException e) { log.error("[命令发送失败] 国标级联 录像播放完毕: {}", e.getMessage()); }