| | |
| | | package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.notify.cmd; |
| | | |
| | | import com.genersoft.iot.vmp.conf.SipConfig; |
| | | import com.genersoft.iot.vmp.conf.UserSetup; |
| | | import com.genersoft.iot.vmp.gb28181.bean.*; |
| | | import com.genersoft.iot.vmp.gb28181.event.DeviceOffLineDetector; |
| | |
| | | |
| | | import javax.sip.RequestEvent; |
| | | |
| | | import static com.genersoft.iot.vmp.gb28181.utils.XmlUtil.getText; |
| | | import static com.genersoft.iot.vmp.gb28181.utils.XmlUtil.*; |
| | | |
| | | @Component |
| | | public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent implements InitializingBean, IMessageHandler { |
| | |
| | | private UserSetup userSetup; |
| | | |
| | | @Autowired |
| | | private SipConfig sipConfig; |
| | | |
| | | @Autowired |
| | | private IVideoManagerStorager storager; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Override |
| | | public void handForDevice(RequestEvent evt, Device device, Element rootElement) { |
| | | if (!sipConfig.isAlarm()) { |
| | | return; |
| | | } |
| | | Element deviceIdElement = rootElement.element("DeviceID"); |
| | | String channelId = deviceIdElement.getText().toString(); |
| | | DeviceAlarm deviceAlarm = new DeviceAlarm(); |
| | |
| | | storager.insertMobilePosition(mobilePosition); |
| | | } |
| | | } |
| | | if (!StringUtils.isEmpty(deviceAlarm.getDeviceId())) { |
| | | if (deviceAlarm.getAlarmMethod().equals("5")) { |
| | | deviceAlarm.setAlarmType(getText(rootElement.element("Info"), "AlarmType")); |
| | | } |
| | | } |
| | | logger.debug("存储报警信息、报警分类"); |
| | | // 存储报警信息、报警分类 |
| | | deviceAlarmService.add(deviceAlarm); |