From 56859d09df8d4226882d43934acf32d60a3b51d7 Mon Sep 17 00:00:00 2001 From: panlinlin <648540858@qq.com> Date: 星期二, 30 三月 2021 18:46:34 +0800 Subject: [PATCH] 添加推流列表和拉流代理,下一步与国标关联 --- src/main/java/com/genersoft/iot/vmp/gb28181/transmit/response/impl/RegisterResponseProcessor.java | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/response/impl/RegisterResponseProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/response/impl/RegisterResponseProcessor.java index aa6b5ab..38b0f07 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/response/impl/RegisterResponseProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/response/impl/RegisterResponseProcessor.java @@ -50,7 +50,6 @@ */ @Override public void process(ResponseEvent evt, SipLayer layer, SipConfig config) { - // TODO Auto-generated method stub Response response = evt.getResponse(); CallIdHeader callIdHeader = (CallIdHeader) response.getHeader(CallIdHeader.NAME); String callId = callIdHeader.getCallId(); @@ -60,16 +59,17 @@ logger.info(String.format("鏈壘鍒癱allId锛� %s 鐨勬敞鍐�/娉ㄩ攢骞冲彴id", callId )); return; } - logger.info(String.format("鏀跺埌 %s 鐨勬敞鍐�/娉ㄩ攢%S鍝嶅簲", platformGBId, response.getStatusCode() )); ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(platformGBId); if (parentPlatformCatch == null) { logger.warn(String.format("鏀跺埌 %s 鐨勬敞鍐�/娉ㄩ攢%S璇锋眰, 浣嗘槸骞冲彴缂撳瓨淇℃伅鏈煡璇㈠埌!!!", platformGBId, response.getStatusCode())); return; } + String action = parentPlatformCatch.getParentPlatform().getExpires().equals("0") ? "娉ㄩ攢" : "娉ㄥ唽"; + logger.info(String.format("鏀跺埌 %s %s鐨�%S鍝嶅簲", platformGBId, action, response.getStatusCode() )); ParentPlatform parentPlatform = parentPlatformCatch.getParentPlatform(); if (parentPlatform == null) { - logger.warn(String.format("鏀跺埌 %s 鐨勬敞鍐�/娉ㄩ攢%S璇锋眰, 浣嗘槸骞冲彴淇℃伅鏈煡璇㈠埌!!!", platformGBId, response.getStatusCode())); + logger.warn(String.format("鏀跺埌 %s %s鐨�%S璇锋眰, 浣嗘槸骞冲彴淇℃伅鏈煡璇㈠埌!!!", platformGBId, action, response.getStatusCode())); return; } @@ -77,11 +77,16 @@ WWWAuthenticateHeader www = (WWWAuthenticateHeader)response.getHeader(WWWAuthenticateHeader.NAME); sipCommanderForPlatform.register(parentPlatform, callId, www, null, null); }else if (response.getStatusCode() == 200){ - // 娉ㄥ唽鎴愬姛 - logger.info(String.format("%s 娉ㄥ唽鎴愬姛", platformGBId )); + // 娉ㄥ唽/娉ㄩ攢鎴愬姛 + logger.info(String.format("%s %s鎴愬姛", platformGBId, action)); redisCatchStorage.delPlatformRegisterInfo(callId); parentPlatform.setStatus(true); + // 鍙栧洖Expires璁剧疆锛岄伩鍏嶆敞閿�杩囩▼涓缃负0 + ParentPlatform parentPlatformTmp = storager.queryParentPlatById(platformGBId); + String expires = parentPlatformTmp.getExpires(); + parentPlatform.setExpires(expires); storager.updateParentPlatform(parentPlatform); + redisCatchStorage.updatePlatformRegister(parentPlatform); redisCatchStorage.updatePlatformKeepalive(parentPlatform); -- Gitblit v1.8.0