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