keepalive 心跳 时间可配置

新增配置 gb28181.sip.keep-alive 默认 60
This commit is contained in:
shikong 2023-10-02 02:51:08 +08:00
parent 20ec4a49f4
commit 902f6cc72b
2 changed files with 5 additions and 1 deletions

View File

@ -31,6 +31,8 @@ public class SipConfig {
Integer ptzSpeed = 50;
Integer keepAlive = 60;
Integer registerTimeInterval = 120;
private String transport = ListeningPoint.UDP;

View File

@ -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);
}