From 98d12ecd6bdc49e6bed86eda4f55ab75e940ca36 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期五, 11 三月 2022 09:49:48 +0800
Subject: [PATCH] Merge pull request #388 from AbnerSC/wvp-28181-2.0
---
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 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 a5dced3..ffac1d0 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
@@ -78,26 +78,25 @@
if (response.getStatusCode() == 401) {
WWWAuthenticateHeader www = (WWWAuthenticateHeader)response.getHeader(WWWAuthenticateHeader.NAME);
- sipCommanderForPlatform.register(parentPlatform, callId, www, null, null);
+ sipCommanderForPlatform.register(parentPlatform, callId, www, null, null, true);
}else if (response.getStatusCode() == 200){
// 娉ㄥ唽/娉ㄩ攢鎴愬姛
logger.info(String.format("%s %s鎴愬姛", platformGBId, action));
redisCatchStorage.delPlatformRegisterInfo(callId);
parentPlatform.setStatus("娉ㄥ唽".equals(action));
// 鍙栧洖Expires璁剧疆锛岄伩鍏嶆敞閿�杩囩▼涓缃负0
- ParentPlatform parentPlatformTmp = storager.queryParentPlatByServerGBId(platformGBId);
- String expires = parentPlatformTmp.getExpires();
- parentPlatform.setExpires(expires);
- parentPlatform.setId(parentPlatformTmp.getId());
+ if (!parentPlatformCatch.getParentPlatform().getExpires().equals("0")) {
+ ParentPlatform parentPlatformTmp = storager.queryParentPlatByServerGBId(platformGBId);
+ String expires = parentPlatformTmp.getExpires();
+ parentPlatform.setExpires(expires);
+ parentPlatform.setId(parentPlatformTmp.getId());
+ redisCatchStorage.updatePlatformRegister(parentPlatform);
+ redisCatchStorage.updatePlatformKeepalive(parentPlatform);
+ parentPlatformCatch.setParentPlatform(parentPlatform);
+ redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
+ }
storager.updateParentPlatformStatus(platformGBId, "娉ㄥ唽".equals(action));
- redisCatchStorage.updatePlatformRegister(parentPlatform);
-
- redisCatchStorage.updatePlatformKeepalive(parentPlatform);
-
- parentPlatformCatch.setParentPlatform(parentPlatform);
-
- redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
}
}
--
Gitblit v1.8.0