From c1d7f867c2ffcb1364334a5e013eb8f208819ef5 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期四, 10 三月 2022 20:53:56 +0800 Subject: [PATCH] 优化目录订阅以及国标级联目录订阅回复 --- 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