648540858
2022-04-12 3955e6ed53d450f8faf488d4b74ba0c0c83c5aaa
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java
@@ -7,7 +7,7 @@
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder;
import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo;
import com.genersoft.iot.vmp.gb28181.task.GPSSubscribeTask;
import com.genersoft.iot.vmp.gb28181.task.impl.MobilePositionSubscribeHandlerTask;
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
@@ -69,7 +69,6 @@
   @Autowired
   private UserSetting userSetting;
   @Autowired
   private SubscribeHolder subscribeHolder;
@@ -138,6 +137,9 @@
      String deviceID = XmlUtil.getText(rootElement, "DeviceID");
      ParentPlatform platform = storager.queryParentPlatByServerGBId(platformId);
      SubscribeInfo subscribeInfo = new SubscribeInfo(evt, platformId);
      if (platform == null) {
         return;
      }
      if (evt.getServerTransaction() == null) {
         ServerTransaction serverTransaction = platform.getTransport().equals("TCP") ? tcpSipProvider.getNewServerTransaction(evt.getRequest())
               : udpSipProvider.getNewServerTransaction(evt.getRequest());
@@ -148,7 +150,7 @@
      }
      String sn = XmlUtil.getText(rootElement, "SN");
      String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetting.getServerId() +  "_MobilePosition_" + platformId;
      logger.info("接收到{}的MobilePosition订阅", platformId);
      logger.info("[notify-MobilePosition]: {}", platformId);
      StringBuilder resultXml = new StringBuilder(200);
      resultXml.append("<?xml version=\"1.0\" ?>\r\n")
            .append("<Response>\r\n")
@@ -163,7 +165,7 @@
            dynamicTask.stop(key);
         }
         String interval = XmlUtil.getText(rootElement, "Interval"); // GPS上报时间间隔
         dynamicTask.startCron(key, new GPSSubscribeTask(redisCatchStorage, sipCommanderForPlatform, storager,  platformId, sn, key, subscribeHolder), Integer.parseInt(interval));
         dynamicTask.startCron(key, new MobilePositionSubscribeHandlerTask(redisCatchStorage, sipCommanderForPlatform, storager,  platformId, sn, key, subscribeHolder), Integer.parseInt(interval) -1 );
         subscribeHolder.putMobilePositionSubscribe(platformId, subscribeInfo);
      }else if (subscribeInfo.getExpires() == 0) {
         dynamicTask.stop(key);
@@ -201,7 +203,7 @@
      }
      String sn = XmlUtil.getText(rootElement, "SN");
      String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetting.getServerId() +  "_Catalog_" + platformId;
      logger.info("接收到{}的Catalog订阅", platformId);
      logger.info("[notify-Catalog]: {}", platformId);
      StringBuilder resultXml = new StringBuilder(200);
      resultXml.append("<?xml version=\"1.0\" ?>\r\n")
            .append("<Response>\r\n")