From cdc726999bd1f6ec3d85ed80f413dacd8b958b8c Mon Sep 17 00:00:00 2001 From: zxb <919411476@qq.com> Date: Fri, 13 Oct 2023 14:57:52 +0800 Subject: [PATCH] =?UTF-8?q?MediaStatus=20=E6=9C=AA=E6=89=BE=E5=88=B0?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E4=BF=A1=E6=81=AF=E6=97=B6=20=E4=BE=9D?= =?UTF-8?q?=E7=84=B6=E9=9C=80=E8=A6=81=E5=90=91=E5=8F=91=E9=80=81=20bye=20?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=20=E9=98=B2=E6=AD=A2=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=9C=AA=E6=94=B6=E5=88=B0bye=20=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E8=87=AA=E5=8A=A8=E7=BB=93=E6=9D=9F=E4=B8=80=E7=9B=B4?= =?UTF-8?q?=E5=8D=A1=E6=AD=BB=20=E6=97=A0=E6=B3=95=E5=90=8E=E7=BB=AD?= =?UTF-8?q?=E7=82=B9=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/message/MessageRequestProcessor.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/MessageRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/MessageRequestProcessor.java index 0c23acea..91ea5f11 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/MessageRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/MessageRequestProcessor.java @@ -30,6 +30,8 @@ import java.text.ParseException; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import static com.genersoft.iot.vmp.gb28181.utils.XmlUtil.getText; + @Component public class MessageRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor { @@ -73,12 +75,24 @@ public class MessageRequestProcessor extends SIPRequestProcessorParent implement // 先从会话内查找 SsrcTransaction ssrcTransaction = sessionManager.getSsrcTransaction(null, null, callIdHeader.getCallId(), null); // 兼容海康 媒体通知 消息from字段不是设备ID的问题 - if (ssrcTransaction != null) { - deviceId = ssrcTransaction.getDeviceId(); +// if (ssrcTransaction != null) { +// deviceId = ssrcTransaction.getDeviceId(); +// } + // 查询设备是否存在 + Device device = redisCatchStorage.getDevice(deviceId); + // 兼容海康 媒体通知 消息体中获取 + if(device == null){ + Element rootElement = null; + try { + rootElement = getRootElement(evt); + if (rootElement != null) { + deviceId = getText(rootElement, "DeviceID"); + } + } catch (Exception ignore) {} } SIPRequest request = (SIPRequest) evt.getRequest(); // 查询设备是否存在 - Device device = redisCatchStorage.getDevice(deviceId); + device = redisCatchStorage.getDevice(deviceId); // 查询上级平台是否存在 ParentPlatform parentPlatform = storage.queryParentPlatByServerGBId(deviceId); try {