From ccbef9b5331eab2a9389bb017d8016b996c4b5dd Mon Sep 17 00:00:00 2001
From: 逐浪人 <zhulangren@gmail.com>
Date: 星期二, 21 三月 2023 19:39:54 +0800
Subject: [PATCH] Update UserController.java
---
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
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 6415241..dc5c31a 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
@@ -16,6 +16,7 @@
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.dao.dto.PlatformRegisterInfo;
import com.genersoft.iot.vmp.utils.DateUtil;
+import com.genersoft.iot.vmp.utils.GitUtil;
import gov.nist.javax.sip.message.MessageFactoryImpl;
import gov.nist.javax.sip.message.SIPRequest;
import org.slf4j.Logger;
@@ -64,6 +65,9 @@
@Autowired
private DynamicTask dynamicTask;
+
+ @Autowired
+ private GitUtil gitUtil;
@Override
public void register(ParentPlatform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException {
@@ -225,6 +229,7 @@
catalogXml.append("<IPAddress>" + channel.getIpAddress() + "</IPAddress>\r\n");
catalogXml.append("<Port>" + channel.getPort() + "</Port>\r\n");
catalogXml.append("<Password>" + channel.getPort() + "</Password>\r\n");
+ catalogXml.append("<PTZType>" + channel.getPTZType() + "</PTZType>\r\n");
catalogXml.append("<Status>" + (channel.getStatus() == 1?"ON":"OFF") + "</Status>\r\n");
catalogXml.append("<Longitude>" +
(channel.getLongitudeWgs84() != 0? channel.getLongitudeWgs84():channel.getLongitude())
@@ -265,6 +270,9 @@
String callId = request.getCallIdHeader().getCallId();
+ logger.info("[鍛戒护鍙戦�乚 鍥芥爣绾ц仈{} 鐩綍鏌ヨ鍥炲: 鍏眥}鏉★紝宸插彂閫亄}鏉�", parentPlatform.getServerGBId(),
+ channels.size(), Math.min(index + parentPlatform.getCatalogGroup(), channels.size()));
+ logger.debug(catalogXml);
if (sendAfterResponse) {
// 榛樿鎸夌収鏀跺埌200鍥炲鍚庡彂閫佷笅涓�鏉★紝 濡傛灉瓒呮椂鏀朵笉鍒板洖澶嶏紝灏变互30姣鐨勯棿闅旂洿鎺ュ彂閫併��
dynamicTask.startDelay(timeoutTaskKey, ()->{
@@ -316,17 +324,22 @@
if (parentPlatform == null) {
return;
}
+ String deviceId = device == null ? parentPlatform.getDeviceGBId() : device.getDeviceId();
+ String deviceName = device == null ? parentPlatform.getName() : device.getName();
+ String manufacturer = device == null ? "WVP-28181-PRO" : device.getManufacturer();
+ String model = device == null ? "platform" : device.getModel();
+ String firmware = device == null ? gitUtil.getBuildVersion() : device.getFirmware();
String characterSet = parentPlatform.getCharacterSet();
StringBuffer deviceInfoXml = new StringBuffer(600);
deviceInfoXml.append("<?xml version=\"1.0\" encoding=\"" + characterSet + "\"?>\r\n");
deviceInfoXml.append("<Response>\r\n");
deviceInfoXml.append("<CmdType>DeviceInfo</CmdType>\r\n");
deviceInfoXml.append("<SN>" +sn + "</SN>\r\n");
- deviceInfoXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n");
- deviceInfoXml.append("<DeviceName>" + device.getName() + "</DeviceName>\r\n");
- deviceInfoXml.append("<Manufacturer>" + device.getManufacturer() + "</Manufacturer>\r\n");
- deviceInfoXml.append("<Model>" + device.getModel() + "</Model>\r\n");
- deviceInfoXml.append("<Firmware>" + device.getFirmware() + "</Firmware>\r\n");
+ deviceInfoXml.append("<DeviceID>" + deviceId + "</DeviceID>\r\n");
+ deviceInfoXml.append("<DeviceName>" + deviceName + "</DeviceName>\r\n");
+ deviceInfoXml.append("<Manufacturer>" + manufacturer + "</Manufacturer>\r\n");
+ deviceInfoXml.append("<Model>" + model + "</Model>\r\n");
+ deviceInfoXml.append("<Firmware>" + firmware + "</Firmware>\r\n");
deviceInfoXml.append("<Result>OK</Result>\r\n");
deviceInfoXml.append("</Response>\r\n");
@@ -402,7 +415,7 @@
if (parentPlatform == null) {
return;
}
- logger.info("[鍙戦�佹姤璀﹂�氱煡] {}/{}->{},{}: {}", parentPlatform.getServerGBId(), deviceAlarm.getChannelId(),
+ logger.info("[鍙戦�佹姤璀﹂�氱煡]骞冲彴锛� {}/{}->{},{}: {}", parentPlatform.getServerGBId(), deviceAlarm.getChannelId(),
deviceAlarm.getLongitude(), deviceAlarm.getLatitude(), JSON.toJSONString(deviceAlarm));
String characterSet = parentPlatform.getCharacterSet();
StringBuffer deviceStatusXml = new StringBuffer(600);
--
Gitblit v1.8.0