Commit 4c4b62cb3aa129d373bfe9aeabde33de9bacdafd
1 parent
abd569d7
支持设置级联注册失败时再次注册的时间
Showing
3 changed files
with
13 additions
and
2 deletions
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 | } | ... | ... |