From 250a059ca0c754b6b56de9c4b677ffd2d0f20b9f Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Tue, 13 Sep 2022 14:53:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=9B=AE=E5=BD=95=E5=8F=91?= =?UTF-8?q?=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gb28181/transmit/cmd/impl/SIPCommander.java | 4 +--- .../cmd/impl/SIPCommanderFroPlatform.java | 15 +++++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java index 2d305c06..163467dc 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java @@ -1620,13 +1620,11 @@ public class SIPCommander implements ISIPCommander { clientTransaction = udpSipProvider.getNewClientTransaction(request); } if (request.getHeader(UserAgentHeader.NAME) == null) { - UserAgentHeader userAgentHeader = null; try { - userAgentHeader = SipUtils.createUserAgentHeader(sipFactory, gitUtil); + request.addHeader(SipUtils.createUserAgentHeader(sipFactory, gitUtil)); } catch (ParseException e) { logger.error("添加UserAgentHeader失败", e); } - request.addHeader(userAgentHeader); } CallIdHeader callIdHeader = (CallIdHeader)request.getHeader(CallIdHeader.NAME); // 添加错误订阅 diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java index 4ab4d7fe..0e6d4b8c 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java @@ -258,6 +258,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { if (channel.getParentId() != null) { // 业务分组加上这一项即可,提高兼容性, catalogXml.append("" + channel.getParentId() + "\r\n"); +// catalogXml.append("" + parentPlatform.getDeviceGBId() + "/" + channel.getParentId() + "\r\n"); } if (channel.getChannelId().length() == 20 && Integer.parseInt(channel.getChannelId().substring(10, 13)) == 216) { // 虚拟组织增加BusinessGroupID字段 @@ -268,21 +269,23 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { if (channel.getParental() == 0) { catalogXml.append("" + (channel.getStatus() == 0 ? "OFF" : "ON") + "\r\n"); } - } if (channel.getParental() == 0) { // 通道项 catalogXml.append("" + channel.getManufacture() + "\r\n"); catalogXml.append("" + channel.getSecrecy() + "\r\n"); catalogXml.append("" + channel.getRegisterWay() + "\r\n"); - + String civilCode = channel.getCivilCode() == null?parentPlatform.getAdministrativeDivision() : channel.getCivilCode(); if (channel.getChannelType() != 2) { // 业务分组/虚拟组织/行政区划 不设置以下属性 catalogXml.append("" + channel.getModel() + "\r\n"); - catalogXml.append(" " + channel.getOwner()+ "\r\n"); - catalogXml.append("" + channel.getCivilCode() + "\r\n"); - catalogXml.append("
" + channel.getAddress() + "
\r\n"); + catalogXml.append("" + parentPlatform.getDeviceGBId()+ "\r\n"); + catalogXml.append("" + civilCode + "\r\n"); + if (channel.getAddress() == null) { + catalogXml.append("
\r\n"); + }else { + catalogXml.append("
" + channel.getAddress() + "
\r\n"); + } } - } catalogXml.append("\r\n"); }