| | |
| | | @Autowired
|
| | | private SIPCommander cmder;
|
| | |
|
| | |
|
| | | private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
| | |
|
| | | @Override
|
| | | public void onApplicationEvent(OnlineEvent event) {
|
| | | |
| | | if (logger.isDebugEnabled()) {
|
| | | logger.debug("设备上线事件触发,deviceId:" + event.getDevice().getDeviceId() + ",from:" + event.getFrom());
|
| | | }
|
| | |
|
| | | logger.info("设备上线事件触发,deviceId:" + event.getDevice().getDeviceId() + ",from:" + event.getFrom());
|
| | | Device device = event.getDevice();
|
| | | if (device == null) return;
|
| | | if (device == null) {
|
| | | return;
|
| | | }
|
| | | String key = VideoManagerConstants.KEEPLIVEKEY_PREFIX + userSetting.getServerId() + "_" + event.getDevice().getDeviceId();
|
| | | Device deviceInStore = storager.queryVideoDevice(device.getDeviceId());
|
| | | device.setOnline(1);
|
| | |
| | | if (deviceInStore == null) { //第一次上线
|
| | | logger.info("[{}] 首次注册,查询设备信息以及通道信息", device.getDeviceId());
|
| | | cmder.deviceInfoQuery(device);
|
| | | cmder.catalogQuery(device, null);
|
| | | deviceService.sync(device);
|
| | | }
|
| | | break;
|
| | | // 设备主动发送心跳触发的在线事件
|