648540858
2022-02-24 a42dda2bd3cc1cf8c20cc61e7ad9211eadecbaf3
src/main/java/com/genersoft/iot/vmp/gb28181/event/platformKeepaliveExpire/PlatformKeepaliveExpireEventLister.java
@@ -18,7 +18,7 @@
import javax.sip.message.Response;
/**
 * @Description: 平台心跳超时事件
 * @description: 平台心跳超时事件
 * @author: panll
 * @date: 2020年11月5日 10:00
 */
@@ -63,8 +63,10 @@
        if (parentPlatformCatch.getKeepAliveReply() >= 3) {
            // 有3次未收到心跳回复, 设置平台状态为离线, 开始重新注册
            logger.warn("有3次未收到心跳回复,标记设置平台状态为离线, 并重新注册 平台国标ID:" + event.getPlatformGbID());
            storager.updateParentPlatformStatus(event.getPlatformGbID(), false);
            publisher.platformNotRegisterEventPublish(event.getPlatformGbID());
            parentPlatformCatch.setKeepAliveReply(0);
            redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
        }else {
            // 再次发送心跳
            String callId = sipCommanderForPlatform.keepalive(parentPlatform);
@@ -74,8 +76,8 @@
            redisCatchStorage.updatePlatformKeepalive(parentPlatform);
            redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
            sipSubscribe.addOkSubscribe(callId, (ResponseEvent responseEvent) ->{
                if (responseEvent.getResponse().getStatusCode() == Response.OK) {
            sipSubscribe.addOkSubscribe(callId, (SipSubscribe.EventResult eventResult) ->{
                if (eventResult.statusCode == Response.OK) {
                    // 收到心跳响应信息,
                    parentPlatformCatch.setKeepAliveReply(0);
                    redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);