Commit 38980826f9789745c7288e2e9c800873315a9228
1 parent
e932a9b8
修复平台删除时未移除心跳超时重新注册任务的问题 #1329
Showing
2 changed files
with
6 additions
and
10 deletions
src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java
| ... | ... | @@ -7,7 +7,6 @@ import com.genersoft.iot.vmp.gb28181.bean.*; |
| 7 | 7 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; |
| 8 | 8 | import com.genersoft.iot.vmp.gb28181.session.SSRCFactory; |
| 9 | 9 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; |
| 10 | -import com.genersoft.iot.vmp.gb28181.utils.SipUtils; | |
| 11 | 10 | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| 12 | 11 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| 13 | 12 | import com.genersoft.iot.vmp.service.IMediaServerService; |
| ... | ... | @@ -18,22 +17,18 @@ import com.genersoft.iot.vmp.storager.dao.*; |
| 18 | 17 | import com.genersoft.iot.vmp.utils.DateUtil; |
| 19 | 18 | import com.github.pagehelper.PageHelper; |
| 20 | 19 | import com.github.pagehelper.PageInfo; |
| 21 | -import gov.nist.javax.sip.message.SIPRequest; | |
| 22 | 20 | import org.slf4j.Logger; |
| 23 | 21 | import org.slf4j.LoggerFactory; |
| 24 | 22 | import org.springframework.beans.factory.annotation.Autowired; |
| 25 | 23 | import org.springframework.stereotype.Service; |
| 26 | 24 | |
| 27 | 25 | import javax.sip.InvalidArgumentException; |
| 28 | -import javax.sip.PeerUnavailableException; | |
| 29 | 26 | import javax.sip.SipException; |
| 30 | -import javax.sip.SipFactory; | |
| 31 | -import javax.sip.address.Address; | |
| 32 | -import javax.sip.address.SipURI; | |
| 33 | -import javax.sip.header.*; | |
| 34 | -import javax.sip.message.Request; | |
| 35 | 27 | import java.text.ParseException; |
| 36 | -import java.util.*; | |
| 28 | +import java.util.HashMap; | |
| 29 | +import java.util.List; | |
| 30 | +import java.util.Map; | |
| 31 | +import java.util.UUID; | |
| 37 | 32 | |
| 38 | 33 | /** |
| 39 | 34 | * @author lin |
| ... | ... | @@ -366,7 +361,6 @@ public class PlatformServiceImpl implements IPlatformService { |
| 366 | 361 | ()-> registerTask(platform, null), |
| 367 | 362 | userSetting.getRegisterAgainAfterTime() * 1000); |
| 368 | 363 | } |
| 369 | - | |
| 370 | 364 | } |
| 371 | 365 | } |
| 372 | 366 | ... | ... |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
| ... | ... | @@ -239,6 +239,8 @@ public class PlatformController { |
| 239 | 239 | if (parentPlatformCatch == null) { |
| 240 | 240 | throw new ControllerException(ErrorCode.ERROR100.getCode(), "平台不存在"); |
| 241 | 241 | } |
| 242 | + parentPlatform.setEnable(false); | |
| 243 | + storager.updateParentPlatform(parentPlatform); | |
| 242 | 244 | // 发送离线消息,无论是否成功都删除缓存 |
| 243 | 245 | try { |
| 244 | 246 | commanderForPlatform.unregister(parentPlatform, parentPlatformCatch.getSipTransactionInfo(), (event -> { | ... | ... |