| | |
| | | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; |
| | | import com.genersoft.iot.vmp.service.IDeviceService; |
| | | import com.genersoft.iot.vmp.service.bean.CatalogSubscribeTask; |
| | | import com.genersoft.iot.vmp.service.bean.MobilePositionSubscribeTask; |
| | | import com.genersoft.iot.vmp.gb28181.task.impl.CatalogSubscribeTask; |
| | | import com.genersoft.iot.vmp.gb28181.task.impl.MobilePositionSubscribeTask; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | int subscribeCycleForCatalog = device.getSubscribeCycleForCatalog(); |
| | | // 设置最小值为30 |
| | | subscribeCycleForCatalog = Math.max(subscribeCycleForCatalog, 30); |
| | | dynamicTask.startCron(device.getDeviceId() + "catalog", catalogSubscribeTask, subscribeCycleForCatalog - 5); |
| | | dynamicTask.startCron(device.getDeviceId() + "catalog", catalogSubscribeTask, subscribeCycleForCatalog); |
| | | return true; |
| | | } |
| | | |
| | |
| | | } |
| | | logger.info("移除目录订阅: {}", device.getDeviceId()); |
| | | dynamicTask.stop(device.getDeviceId() + "catalog"); |
| | | device.setSubscribeCycleForCatalog(0); |
| | | sipCommander.catalogSubscribe(device, null, null); |
| | | return true; |
| | | } |
| | | |
| | |
| | | int subscribeCycleForCatalog = device.getSubscribeCycleForCatalog(); |
| | | // 设置最小值为30 |
| | | subscribeCycleForCatalog = Math.max(subscribeCycleForCatalog, 30); |
| | | dynamicTask.startCron(device.getDeviceId() + "mobile_position" , mobilePositionSubscribeTask, subscribeCycleForCatalog - 5); |
| | | dynamicTask.startCron(device.getDeviceId() + "mobile_position" , mobilePositionSubscribeTask, subscribeCycleForCatalog -1 ); |
| | | return true; |
| | | } |
| | | |
| | |
| | | } |
| | | logger.info("移除移动位置订阅: {}", device.getDeviceId()); |
| | | dynamicTask.stop(device.getDeviceId() + "mobile_position"); |
| | | device.setSubscribeCycleForCatalog(0); |
| | | sipCommander.mobilePositionSubscribe(device, null, null); |
| | | return true; |
| | | } |
| | | } |