From 8b6449ce3ac8eb4a0f59f3a6e3974d9190dcd133 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Mon, 29 Aug 2022 09:55:09 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E7=89=88=E6=9C=AC?=
=?UTF-8?q?=E5=8F=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 2 +-
sql/update.sql | 84 -------------------
.../transmit/SIPProcessorObserver.java | 2 +-
3 files changed, 2 insertions(+), 86 deletions(-)
diff --git a/pom.xml b/pom.xml
index 2b9a838c6..71dd94850 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
com.genersoft
wvp-pro
- 2.3.1
+ 2.3.2
web video platform
国标28181视频平台
diff --git a/sql/update.sql b/sql/update.sql
index d61ad3538..e69de29bb 100644
--- a/sql/update.sql
+++ b/sql/update.sql
@@ -1,84 +0,0 @@
-alter table stream_push
- add serverId varchar(50) not null;
-
-alter table device
- add geoCoordSys varchar(50) not null;
-alter table device
- add treeType varchar(50) not null;
-update device set device.geoCoordSys='WGS84';
-update device set device.treeType='CivilCode';
-
-alter table device_channel
- add longitudeGcj02 double default null;
-alter table device_channel
- add latitudeGcj02 double default null;
-alter table device_channel
- add longitudeWgs84 double default null;
-alter table device_channel
- add latitudeWgs84 double default null;
-alter table device_channel
- add businessGroupId varchar(50) default null;
-alter table device_channel
- add gpsTime varchar(50) default null;
-
-
-alter table device_mobile_position
- change cnLng longitudeGcj02 double default null;
-alter table device_mobile_position
- change cnLat latitudeGcj02 double default null;
-alter table device_mobile_position
- add longitudeWgs84 double default null;
-alter table device_mobile_position
- add latitudeWgs84 double default null;
-alter table device_mobile_position
- drop geodeticSystem;
-alter table device_mobile_position
- add createTime varchar(50) default null;
-
-alter table device_alarm
- add createTime varchar(50) default null;
-
-alter table gb_stream
- change createStamp createTime varchar(50) default null;
-
-alter table parent_platform
- add createTime varchar(50) default null;
-alter table parent_platform
- add updateTime varchar(50) default null;
-
-alter table stream_proxy
- add updateTime varchar(50) default null;
-
-alter table stream_push
- add pushTime varchar(50) default null;
-alter table stream_push
- add status int DEFAULT NULL;
-alter table stream_push
- add updateTime varchar(50) default null;
-alter table stream_push
- add pushIng int DEFAULT NULL;
-alter table stream_push
- change createStamp createTime varchar(50) default null;
-
-alter table gb_stream
- drop column status;
-
-alter table user
- add pushKey varchar(50) default null;
-update user set pushKey='453df297a57a5a7438934sda801fc3' where id=1;
-
-alter table parent_platform
- add treeType varchar(50) not null;
-update parent_platform set parent_platform.treeType='BusinessGroup';
-alter table parent_platform drop shareAllLiveStream;
-
-alter table platform_catalog
- add civilCode varchar(50) default null;
-alter table platform_catalog
- add businessGroupId varchar(50) default null;
-
-/********************* ADD ***************************/
-alter table stream_push
- add self int DEFAULT NULL;
-
-
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorObserver.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorObserver.java
index d20dc74d3..13f04b6d4 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorObserver.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorObserver.java
@@ -112,7 +112,7 @@ public class SIPProcessorObserver implements ISIPProcessorObserver {
} else if ((status >= 100) && (status < 200)) {
// 增加其它无需回复的响应,如101、180等
} else {
- logger.warn("接收到失败的response响应!status:" + status + ",message:" + response.getReasonPhrase()/* .getContent().toString()*/);
+ logger.warn("接收到失败的response响应!status:" + status + ",message:" + response.getReasonPhrase());
if (responseEvent.getResponse() != null && sipSubscribe.getErrorSubscribesSize() > 0 ) {
CallIdHeader callIdHeader = (CallIdHeader)responseEvent.getResponse().getHeader(CallIdHeader.NAME);
if (callIdHeader != null) {
From 6e90050db47ca1d9ecec3de6bd95ea1bd1ca4060 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Mon, 29 Aug 2022 11:50:36 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E5=8E=BB=E9=99=A4zlm=E4=BD=BF=E7=94=A8redi?=
=?UTF-8?q?s=E8=BF=87=E6=9C=9F=E4=BD=9C=E4=B8=BA=E5=BF=83=E8=B7=B3?=
=?UTF-8?q?=E8=B6=85=E6=97=B6=E7=9A=84=E6=96=B9=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../iot/vmp/common/VideoManagerConstants.java | 2 -
...edisKeyExpirationEventMessageListener.java | 3 +-
.../KeepaliveTimeoutListenerForPlatform.java | 81 +++++++++++++++++++
.../zlm/event/ZLMKeepliveTimeoutListener.java | 72 -----------------
.../service/impl/MediaServerServiceImpl.java | 40 +++++++--
5 files changed, 118 insertions(+), 80 deletions(-)
rename src/main/java/com/genersoft/iot/vmp/conf/{ => redis}/RedisKeyExpirationEventMessageListener.java (94%)
create mode 100644 src/main/java/com/genersoft/iot/vmp/gb28181/event/offline/KeepaliveTimeoutListenerForPlatform.java
delete mode 100644 src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMKeepliveTimeoutListener.java
diff --git a/src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java b/src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java
index bbbfce971..7a122c774 100644
--- a/src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java
+++ b/src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java
@@ -14,8 +14,6 @@ public class VideoManagerConstants {
public static final String MEDIA_SERVER_PREFIX = "VMP_MEDIA_SERVER_";
- public static final String MEDIA_SERVER_KEEPALIVE_PREFIX = "VMP_MEDIA_SERVER_KEEPALIVE_";
-
public static final String MEDIA_SERVERS_ONLINE_PREFIX = "VMP_MEDIA_ONLINE_SERVERS_";
public static final String MEDIA_STREAM_PREFIX = "VMP_MEDIA_STREAM";
diff --git a/src/main/java/com/genersoft/iot/vmp/conf/RedisKeyExpirationEventMessageListener.java b/src/main/java/com/genersoft/iot/vmp/conf/redis/RedisKeyExpirationEventMessageListener.java
similarity index 94%
rename from src/main/java/com/genersoft/iot/vmp/conf/RedisKeyExpirationEventMessageListener.java
rename to src/main/java/com/genersoft/iot/vmp/conf/redis/RedisKeyExpirationEventMessageListener.java
index ef4a6172e..b3adab52e 100644
--- a/src/main/java/com/genersoft/iot/vmp/conf/RedisKeyExpirationEventMessageListener.java
+++ b/src/main/java/com/genersoft/iot/vmp/conf/redis/RedisKeyExpirationEventMessageListener.java
@@ -1,5 +1,6 @@
-package com.genersoft.iot.vmp.conf;
+package com.genersoft.iot.vmp.conf.redis;
+import com.genersoft.iot.vmp.conf.UserSetting;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.listener.KeyExpirationEventMessageListener;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/event/offline/KeepaliveTimeoutListenerForPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/event/offline/KeepaliveTimeoutListenerForPlatform.java
new file mode 100644
index 000000000..ead824649
--- /dev/null
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/event/offline/KeepaliveTimeoutListenerForPlatform.java
@@ -0,0 +1,81 @@
+package com.genersoft.iot.vmp.gb28181.event.offline;
+
+import com.genersoft.iot.vmp.conf.UserSetting;
+import com.genersoft.iot.vmp.conf.redis.RedisKeyExpirationEventMessageListener;
+import com.genersoft.iot.vmp.gb28181.bean.Device;
+import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
+import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
+import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.connection.Message;
+import org.springframework.data.redis.listener.RedisMessageListenerContainer;
+import org.springframework.stereotype.Component;
+
+import com.genersoft.iot.vmp.common.VideoManagerConstants;
+import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
+
+/**
+ * 设备心跳超时监听,借助redis过期特性,进行监听,监听到说明设备心跳超时,发送离线事件
+ * @author swwheihei
+ */
+@Component
+public class KeepaliveTimeoutListenerForPlatform extends RedisKeyExpirationEventMessageListener {
+
+ private Logger logger = LoggerFactory.getLogger(KeepaliveTimeoutListenerForPlatform.class);
+
+ @Autowired
+ private EventPublisher publisher;
+
+ @Autowired
+ private UserSetting userSetting;
+
+ @Autowired
+ private SipSubscribe sipSubscribe;
+
+ @Autowired
+ private IVideoManagerStorage storager;
+
+ public KeepaliveTimeoutListenerForPlatform(RedisMessageListenerContainer listenerContainer, UserSetting userSetting) {
+ super(listenerContainer, userSetting);
+ }
+
+
+ /**
+ * 监听失效的key
+ * @param message
+ * @param pattern
+ */
+ @Override
+ public void onMessage(Message message, byte[] pattern) {
+ // 获取失效的key
+ String expiredKey = message.toString();
+ // 平台心跳到期,需要重发, 判断是否已经多次未收到心跳回复, 多次未收到,则重新发起注册, 注册尝试多次未得到回复,则认为平台离线
+ String PLATFORM_KEEPLIVEKEY_PREFIX = VideoManagerConstants.PLATFORM_KEEPALIVE_PREFIX + userSetting.getServerId() + "_";
+ String PLATFORM_REGISTER_PREFIX = VideoManagerConstants.PLATFORM_REGISTER_PREFIX + userSetting.getServerId() + "_";
+ String REGISTER_INFO_PREFIX = VideoManagerConstants.PLATFORM_REGISTER_INFO_PREFIX + userSetting.getServerId() + "_";
+ if (expiredKey.startsWith(PLATFORM_KEEPLIVEKEY_PREFIX)) {
+ String platformGbId = expiredKey.substring(PLATFORM_KEEPLIVEKEY_PREFIX.length());
+ ParentPlatform platform = storager.queryParentPlatByServerGBId(platformGbId);
+ if (platform != null) {
+ publisher.platformKeepaliveExpireEventPublish(platformGbId);
+ }
+ }else if (expiredKey.startsWith(PLATFORM_REGISTER_PREFIX)) {
+ String platformGbId = expiredKey.substring(PLATFORM_REGISTER_PREFIX.length(),expiredKey.length());
+ ParentPlatform platform = storager.queryParentPlatByServerGBId(platformGbId);
+ if (platform != null) {
+ publisher.platformRegisterCycleEventPublish(platformGbId);
+ }
+ }else if (expiredKey.startsWith(REGISTER_INFO_PREFIX)) {
+ String callId = expiredKey.substring(REGISTER_INFO_PREFIX.length());
+ if (sipSubscribe.getErrorSubscribe(callId) != null) {
+ SipSubscribe.EventResult eventResult = new SipSubscribe.EventResult();
+ eventResult.callId = callId;
+ eventResult.msg = "注册超时";
+ eventResult.type = "register timeout";
+ sipSubscribe.getErrorSubscribe(callId).response(eventResult);
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMKeepliveTimeoutListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMKeepliveTimeoutListener.java
deleted file mode 100644
index d3af23c0b..000000000
--- a/src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMKeepliveTimeoutListener.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package com.genersoft.iot.vmp.media.zlm.event;
-
-import com.alibaba.fastjson.JSONObject;
-import com.genersoft.iot.vmp.common.VideoManagerConstants;
-import com.genersoft.iot.vmp.conf.RedisKeyExpirationEventMessageListener;
-import com.genersoft.iot.vmp.conf.UserSetting;
-import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
-import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
-import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
-import com.genersoft.iot.vmp.service.IMediaServerService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.connection.Message;
-import org.springframework.data.redis.listener.RedisMessageListenerContainer;
-import org.springframework.stereotype.Component;
-
-/**
- * @description:设备心跳超时监听,借助redis过期特性,进行监听,监听到说明设备心跳超时,发送离线事件
- * @author: swwheihei
- * @date: 2020年5月6日 上午11:35:46
- */
-@Component
-public class ZLMKeepliveTimeoutListener extends RedisKeyExpirationEventMessageListener {
-
- private Logger logger = LoggerFactory.getLogger(ZLMKeepliveTimeoutListener.class);
-
- @Autowired
- private EventPublisher publisher;
-
- @Autowired
- private ZLMRESTfulUtils zlmresTfulUtils;
-
- @Autowired
- private UserSetting userSetting;
-
- @Autowired
- private IMediaServerService mediaServerService;
-
- public ZLMKeepliveTimeoutListener(RedisMessageListenerContainer listenerContainer, UserSetting userSetting) {
- super(listenerContainer, userSetting);
- }
-
-
- /**
- * 监听失效的key,key格式为keeplive_deviceId
- * @param message
- * @param pattern
- */
- @Override
- public void onMessage(Message message, byte[] pattern) {
- // 获取失效的key
- String expiredKey = message.toString();
- String KEEPLIVEKEY_PREFIX = VideoManagerConstants.MEDIA_SERVER_KEEPALIVE_PREFIX + userSetting.getServerId() + "_";
- if(!expiredKey.startsWith(KEEPLIVEKEY_PREFIX)){
- return;
- }
-
- String mediaServerId = expiredKey.substring(KEEPLIVEKEY_PREFIX.length(),expiredKey.length());
- logger.info("[zlm心跳到期]:" + mediaServerId);
- // 发起http请求验证zlm是否确实无法连接,如果确实无法连接则发送离线事件,否则不作处理
- MediaServerItem mediaServerItem = mediaServerService.getOne(mediaServerId);
- JSONObject mediaServerConfig = zlmresTfulUtils.getMediaServerConfig(mediaServerItem);
- if (mediaServerConfig != null && mediaServerConfig.getInteger("code") == 0) {
- logger.info("[zlm心跳到期]:{}验证后zlm仍在线,恢复心跳信息", mediaServerId);
- // 添加zlm信息
- mediaServerService.updateMediaServerKeepalive(mediaServerId, mediaServerConfig);
- }else {
- publisher.zlmOfflineEventPublish(mediaServerId);
- }
- }
-}
diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
index 55b32d90f..385dd5e44 100644
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
@@ -8,6 +8,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import com.genersoft.iot.vmp.conf.DynamicTask;
import com.genersoft.iot.vmp.conf.exception.ControllerException;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
import org.slf4j.Logger;
@@ -53,6 +54,8 @@ public class MediaServerServiceImpl implements IMediaServerService {
private final static Logger logger = LoggerFactory.getLogger(MediaServerServiceImpl.class);
+ private final String zlmKeepaliveKeyPrefix = "zlm-keepalive_";
+
@Autowired
private SipConfig sipConfig;
@@ -83,10 +86,12 @@ public class MediaServerServiceImpl implements IMediaServerService {
@Autowired
private ZLMRTPServerFactory zlmrtpServerFactory;
-
@Autowired
private EventPublisher publisher;
+ @Autowired
+ private DynamicTask dynamicTask;
+
/**
* 初始化
*/
@@ -398,11 +403,37 @@ public class MediaServerServiceImpl implements IMediaServerService {
if (serverItem.isAutoConfig()) {
setZLMConfig(serverItem, "0".equals(zlmServerConfig.getHookEnable()));
}
+ final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + serverItem.getId();
+ dynamicTask.stop(zlmKeepaliveKey);
+ dynamicTask.startDelay(zlmKeepaliveKey, new KeepAliveTimeoutRunnable(serverItem), serverItem.getHookAliveInterval() * 1000);
publisher.zlmOnlineEventPublish(serverItem.getId());
logger.info("[ZLM] 连接成功 {} - {}:{} ",
zlmServerConfig.getGeneralMediaServerId(), zlmServerConfig.getIp(), zlmServerConfig.getHttpPort());
}
+ class KeepAliveTimeoutRunnable implements Runnable{
+
+ private MediaServerItem serverItem;
+
+ public KeepAliveTimeoutRunnable(MediaServerItem serverItem) {
+ this.serverItem = serverItem;
+ }
+
+ @Override
+ public void run() {
+ logger.info("[zlm心跳到期]:" + serverItem.getId());
+ // 发起http请求验证zlm是否确实无法连接,如果确实无法连接则发送离线事件,否则不作处理
+ JSONObject mediaServerConfig = zlmresTfulUtils.getMediaServerConfig(serverItem);
+ if (mediaServerConfig != null && mediaServerConfig.getInteger("code") == 0) {
+ logger.info("[zlm心跳到期]:{}验证后zlm仍在线,恢复心跳信息,请检查zlm是否可以正常向wvp发送心跳", serverItem.getId());
+ // 添加zlm信息
+ updateMediaServerKeepalive(serverItem.getId(), mediaServerConfig);
+ }else {
+ publisher.zlmOfflineEventPublish(serverItem.getId());
+ }
+ }
+ }
+
@Override
public void zlmServerOffline(String mediaServerId) {
@@ -429,7 +460,6 @@ public class MediaServerServiceImpl implements IMediaServerService {
}else {
clearRTPServer(serverItem);
}
-
}
@@ -625,9 +655,9 @@ public class MediaServerServiceImpl implements IMediaServerService {
return;
}
}
- String key = VideoManagerConstants.MEDIA_SERVER_KEEPALIVE_PREFIX + userSetting.getServerId() + "_" + mediaServerId;
- int hookAliveInterval = mediaServerItem.getHookAliveInterval() + 2;
- RedisUtil.set(key, data, hookAliveInterval);
+ final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + mediaServerItem.getId();
+ dynamicTask.stop(zlmKeepaliveKey);
+ dynamicTask.startDelay(zlmKeepaliveKey, new KeepAliveTimeoutRunnable(mediaServerItem), mediaServerItem.getHookAliveInterval() * 1000);
}
private MediaServerItem getOneFromDatabase(String mediaServerId) {
From 9e2630ee32cf98b7191b8034eabc8f8dd105b22b Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Mon, 29 Aug 2022 14:04:54 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0zlm=E5=BF=83=E8=B7=B3?=
=?UTF-8?q?=E8=B6=85=E6=97=B6=E7=9A=84=E5=88=A4=E5=AE=9A=E6=97=B6=E9=97=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../iot/vmp/service/impl/MediaServerServiceImpl.java | 6 ++++--
.../vmp/vmanager/gb28181/platform/PlatformController.java | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
index 385dd5e44..9ee553109 100644
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
@@ -405,7 +405,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
}
final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + serverItem.getId();
dynamicTask.stop(zlmKeepaliveKey);
- dynamicTask.startDelay(zlmKeepaliveKey, new KeepAliveTimeoutRunnable(serverItem), serverItem.getHookAliveInterval() * 1000);
+ dynamicTask.startDelay(zlmKeepaliveKey, new KeepAliveTimeoutRunnable(serverItem), (serverItem.getHookAliveInterval() + 5) * 1000);
publisher.zlmOnlineEventPublish(serverItem.getId());
logger.info("[ZLM] 连接成功 {} - {}:{} ",
zlmServerConfig.getGeneralMediaServerId(), zlmServerConfig.getIp(), zlmServerConfig.getHttpPort());
@@ -438,6 +438,8 @@ public class MediaServerServiceImpl implements IMediaServerService {
@Override
public void zlmServerOffline(String mediaServerId) {
delete(mediaServerId);
+ final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + mediaServerId;
+ dynamicTask.stop(zlmKeepaliveKey);
}
@Override
@@ -657,7 +659,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
}
final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + mediaServerItem.getId();
dynamicTask.stop(zlmKeepaliveKey);
- dynamicTask.startDelay(zlmKeepaliveKey, new KeepAliveTimeoutRunnable(mediaServerItem), mediaServerItem.getHookAliveInterval() * 1000);
+ dynamicTask.startDelay(zlmKeepaliveKey, new KeepAliveTimeoutRunnable(mediaServerItem), (mediaServerItem.getHookAliveInterval() + 5) * 1000);
}
private MediaServerItem getOneFromDatabase(String mediaServerId) {
diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
index 0e003e576..2a403301e 100644
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
@@ -179,7 +179,8 @@ public class PlatformController {
commanderForPlatform.register(parentPlatform, null, null);
}
- } else if (parentPlatformOld != null && parentPlatformOld.isEnable() && !parentPlatform.isEnable()) { // 关闭启用时注销
+ } else if (parentPlatformOld != null && parentPlatformOld.isEnable()) {
+ // 关闭启用时注销
commanderForPlatform.unregister(parentPlatform, null, null);
}
return null;
From d47902bdca2eb772c974803a5bd72e917a294b39 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Mon, 29 Aug 2022 14:39:18 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=97=B6redis=E6=9C=AA?=
=?UTF-8?q?=E8=BF=9E=E6=8E=A5=E5=AF=BC=E8=87=B4=E6=97=A0=E6=B3=95=E5=90=AF?=
=?UTF-8?q?=E5=8A=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../service/impl/MediaServerServiceImpl.java | 6 +-
.../storager/impl/RedisCatchStorageImpl.java | 1 +
.../iot/vmp/utils/SpringBeanFactory.java | 4 +-
.../iot/vmp/utils/redis/RedisUtil.java | 164 ++++++++++++++++--
4 files changed, 158 insertions(+), 17 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
index 9ee553109..d923755a4 100644
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
@@ -20,7 +20,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;
import org.springframework.util.ObjectUtils;
-import org.springframework.util.StringUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
@@ -40,7 +39,6 @@ import com.genersoft.iot.vmp.service.bean.SSRCInfo;
import com.genersoft.iot.vmp.storager.dao.MediaServerMapper;
import com.genersoft.iot.vmp.utils.DateUtil;
import com.genersoft.iot.vmp.utils.redis.RedisUtil;
-import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
import okhttp3.OkHttpClient;
import okhttp3.Request;
@@ -135,7 +133,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
logger.info("media server [ {} ] ssrcConfig is null", mediaServerItem.getId());
return null;
}else {
- String ssrc = null;
+ String ssrc;
if (presetSsrc != null) {
ssrc = presetSsrc;
}else {
@@ -497,7 +495,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
}
// 获取分数最低的,及并发最低的
- Set