Commit 4c4b62cb3aa129d373bfe9aeabde33de9bacdafd

Authored by 64850858
1 parent abd569d7

支持设置级联注册失败时再次注册的时间

src/main/java/com/genersoft/iot/vmp/conf/SipConfig.java
... ... @@ -34,6 +34,9 @@ public class SipConfig {
34 34 @Value("${sip.keepaliveTimeOut:180}")
35 35 Integer keepaliveTimeOut;
36 36  
  37 + @Value("${sip.registerTimeInterval:60}")
  38 + Integer registerTimeInterval;
  39 +
37 40 public String getMonitorIp() {
38 41 return monitorIp;
39 42 }
... ... @@ -70,5 +73,7 @@ public class SipConfig {
70 73 return keepaliveTimeOut;
71 74 }
72 75  
73   -
  76 + public Integer getRegisterTimeInterval() {
  77 + return registerTimeInterval;
  78 + }
74 79 }
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/event/platformNotRegister/PlatformNotRegisterEventLister.java
1 1 package com.genersoft.iot.vmp.gb28181.event.platformNotRegister;
2 2  
  3 +import com.genersoft.iot.vmp.conf.SipConfig;
3 4 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
4 5 import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
5 6 import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
... ... @@ -38,6 +39,9 @@ public class PlatformNotRegisterEventLister implements ApplicationListener<Platf
38 39 @Autowired
39 40 private ZLMRTPServerFactory zlmrtpServerFactory;
40 41  
  42 + @Autowired
  43 + private SipConfig config;
  44 +
41 45 // @Autowired
42 46 // private RedisUtil redis;
43 47  
... ... @@ -90,6 +94,6 @@ public class PlatformNotRegisterEventLister implements ApplicationListener<Platf
90 94 logger.info("再次向平台注册,平台国标ID:" + event.getPlatformGbID());
91 95 sipCommanderFroPlatform.register(parentPlatform, null, okEvent);
92 96 }
93   - }, 15000, 15000);//十五秒后再次发起注册
  97 + }, config.getRegisterTimeInterval(), config.getRegisterTimeInterval());//十五秒后再次发起注册
94 98 }
95 99 }
... ...
src/main/resources/all-application.yml
... ... @@ -67,6 +67,8 @@ sip:
67 67 password: admin123
68 68 # [可选] 心跳超时时间, 建议设置为心跳周期的三倍
69 69 keepaliveTimeOut: 180
  70 + # [可选] 国标级联注册失败,再次发起注册的时间间隔。 默认60秒
  71 + registerTimeInterval: 60
70 72  
71 73 #zlm 默认服务器配置
72 74 media:
... ...