From 902f6cc72b2bb54031fcca3351773ae68a243222 Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Mon, 2 Oct 2023 02:51:08 +0800 Subject: [PATCH] =?UTF-8?q?keepalive=20=E5=BF=83=E8=B7=B3=20=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=8F=AF=E9=85=8D=E7=BD=AE=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=20gb28181.sip.keep-alive=20=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=2060?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skcks/docking/gb28181/mocking/config/sip/SipConfig.java | 2 ++ .../mocking/service/gb28181/keepalive/KeepaliveService.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/config/sip/SipConfig.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/config/sip/SipConfig.java index a078a17..4883ff7 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/config/sip/SipConfig.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/config/sip/SipConfig.java @@ -31,6 +31,8 @@ public class SipConfig { Integer ptzSpeed = 50; + Integer keepAlive = 60; + Integer registerTimeInterval = 120; private String transport = ListeningPoint.UDP; diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/gb28181/keepalive/KeepaliveService.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/gb28181/keepalive/KeepaliveService.java index a71b715..c431a46 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/gb28181/keepalive/KeepaliveService.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/gb28181/keepalive/KeepaliveService.java @@ -2,6 +2,7 @@ package cn.skcks.docking.gb28181.mocking.service.gb28181.keepalive; import cn.skcks.docking.gb28181.common.xml.XmlUtils; import cn.skcks.docking.gb28181.core.sip.utils.SipUtil; +import cn.skcks.docking.gb28181.mocking.config.sip.SipConfig; import cn.skcks.docking.gb28181.mocking.core.sip.message.processor.message.request.keepalive.KeepaliveNotifyDTO; import cn.skcks.docking.gb28181.mocking.core.sip.request.SipRequestBuilder; import cn.skcks.docking.gb28181.mocking.core.sip.sender.SipSender; @@ -17,6 +18,7 @@ import java.util.concurrent.*; @Service @RequiredArgsConstructor public class KeepaliveService { + private final SipConfig sipConfig; private final SipSender sender; private final ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(); @@ -40,7 +42,7 @@ public class KeepaliveService { SipUtil.generateFromTag(), callIdHeader); }); - }, 0, 30, TimeUnit.SECONDS); + }, 0, sipConfig.getKeepAlive(), TimeUnit.SECONDS); map.put(mockingDevice.getGbDeviceId(), scheduledFuture); }