From 44b06e1b6e2cfcaf4c637ea66a375bf6fcbcf901 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期一, 11 七月 2022 15:26:25 +0800
Subject: [PATCH] 修复默认用户信息插入
---
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java | 34 +++++++++++++++++++---------------
1 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java
index b6040aa..f3a9f65 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java
@@ -2,11 +2,12 @@
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch;
+import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder;
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
import com.genersoft.iot.vmp.gb28181.transmit.event.response.SIPResponseProcessorAbstract;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
-import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
+import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -26,19 +27,22 @@
public class RegisterResponseProcessor extends SIPResponseProcessorAbstract {
private Logger logger = LoggerFactory.getLogger(RegisterResponseProcessor.class);
- private String method = "REGISTER";
+ private final String method = "REGISTER";
@Autowired
private ISIPCommanderForPlatform sipCommanderForPlatform;
@Autowired
- private IVideoManagerStorager storager;
+ private IVideoManagerStorage storager;
@Autowired
private IRedisCatchStorage redisCatchStorage;
@Autowired
private SIPProcessorObserver sipProcessorObserver;
+
+ @Autowired
+ private SubscribeHolder subscribeHolder;
@Override
public void afterPropertiesSet() throws Exception {
@@ -83,21 +87,21 @@
// 娉ㄥ唽/娉ㄩ攢鎴愬姛
logger.info(String.format("%s %s鎴愬姛", platformGBId, action));
redisCatchStorage.delPlatformRegisterInfo(callId);
- parentPlatform.setStatus("娉ㄥ唽".equals(action));
+ redisCatchStorage.delPlatformCatchInfo(platformGBId);
// 鍙栧洖Expires璁剧疆锛岄伩鍏嶆敞閿�杩囩▼涓缃负0
ParentPlatform parentPlatformTmp = storager.queryParentPlatByServerGBId(platformGBId);
- String expires = parentPlatformTmp.getExpires();
- parentPlatform.setExpires(expires);
- parentPlatform.setId(parentPlatformTmp.getId());
- storager.updateParentPlatformStatus(platformGBId, "娉ㄥ唽".equals(action));
-
- redisCatchStorage.updatePlatformRegister(parentPlatform);
-
- redisCatchStorage.updatePlatformKeepalive(parentPlatform);
-
- parentPlatformCatch.setParentPlatform(parentPlatform);
-
+ if (parentPlatformTmp != null) {
+ parentPlatformTmp.setStatus("娉ㄥ唽".equals(action));
+ redisCatchStorage.updatePlatformRegister(parentPlatformTmp);
+ redisCatchStorage.updatePlatformKeepalive(parentPlatformTmp);
+ parentPlatformCatch.setParentPlatform(parentPlatformTmp);
+ }
redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
+ storager.updateParentPlatformStatus(platformGBId, "娉ㄥ唽".equals(action));
+ if ("娉ㄩ攢".equals(action)) {
+ subscribeHolder.removeCatalogSubscribe(platformGBId);
+ subscribeHolder.removeMobilePositionSubscribe(platformGBId);
+ }
}
}
--
Gitblit v1.8.0