Commit 38980826f9789745c7288e2e9c800873315a9228

Authored by 648540858
1 parent e932a9b8

修复平台删除时未移除心跳超时重新注册任务的问题 #1329

src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java
@@ -7,7 +7,6 @@ import com.genersoft.iot.vmp.gb28181.bean.*; @@ -7,7 +7,6 @@ import com.genersoft.iot.vmp.gb28181.bean.*;
7 import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; 7 import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
8 import com.genersoft.iot.vmp.gb28181.session.SSRCFactory; 8 import com.genersoft.iot.vmp.gb28181.session.SSRCFactory;
9 import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; 9 import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform;
10 -import com.genersoft.iot.vmp.gb28181.utils.SipUtils;  
11 import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; 10 import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory;
12 import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; 11 import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
13 import com.genersoft.iot.vmp.service.IMediaServerService; 12 import com.genersoft.iot.vmp.service.IMediaServerService;
@@ -18,22 +17,18 @@ import com.genersoft.iot.vmp.storager.dao.*; @@ -18,22 +17,18 @@ import com.genersoft.iot.vmp.storager.dao.*;
18 import com.genersoft.iot.vmp.utils.DateUtil; 17 import com.genersoft.iot.vmp.utils.DateUtil;
19 import com.github.pagehelper.PageHelper; 18 import com.github.pagehelper.PageHelper;
20 import com.github.pagehelper.PageInfo; 19 import com.github.pagehelper.PageInfo;
21 -import gov.nist.javax.sip.message.SIPRequest;  
22 import org.slf4j.Logger; 20 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory; 21 import org.slf4j.LoggerFactory;
24 import org.springframework.beans.factory.annotation.Autowired; 22 import org.springframework.beans.factory.annotation.Autowired;
25 import org.springframework.stereotype.Service; 23 import org.springframework.stereotype.Service;
26 24
27 import javax.sip.InvalidArgumentException; 25 import javax.sip.InvalidArgumentException;
28 -import javax.sip.PeerUnavailableException;  
29 import javax.sip.SipException; 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 import java.text.ParseException; 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 * @author lin 34 * @author lin
@@ -366,7 +361,6 @@ public class PlatformServiceImpl implements IPlatformService { @@ -366,7 +361,6 @@ public class PlatformServiceImpl implements IPlatformService {
366 ()-> registerTask(platform, null), 361 ()-> registerTask(platform, null),
367 userSetting.getRegisterAgainAfterTime() * 1000); 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,6 +239,8 @@ public class PlatformController {
239 if (parentPlatformCatch == null) { 239 if (parentPlatformCatch == null) {
240 throw new ControllerException(ErrorCode.ERROR100.getCode(), "平台不存在"); 240 throw new ControllerException(ErrorCode.ERROR100.getCode(), "平台不存在");
241 } 241 }
  242 + parentPlatform.setEnable(false);
  243 + storager.updateParentPlatform(parentPlatform);
242 // 发送离线消息,无论是否成功都删除缓存 244 // 发送离线消息,无论是否成功都删除缓存
243 try { 245 try {
244 commanderForPlatform.unregister(parentPlatform, parentPlatformCatch.getSipTransactionInfo(), (event -> { 246 commanderForPlatform.unregister(parentPlatform, parentPlatformCatch.getSipTransactionInfo(), (event -> {