| | |
| | | try { |
| | | HandlerCatchData take = taskQueue.poll(); |
| | | Element rootElement = getRootElement(take.getEvt()); |
| | | if (rootElement == null) { |
| | | logger.error("处理NOTIFY消息时未获取到消息体,{}", take.getEvt().getRequest()); |
| | | continue; |
| | | } |
| | | String cmd = XmlUtil.getText(rootElement, "CmdType"); |
| | | |
| | | if (CmdType.CATALOG.equals(cmd)) { |
| | |
| | | |
| | | // 回复 200 OK |
| | | Element rootElement = getRootElement(evt); |
| | | if (rootElement == null) { |
| | | logger.error("处理MobilePosition移动位置Notify时未获取到消息体,{}", evt.getRequest()); |
| | | return; |
| | | } |
| | | |
| | | MobilePosition mobilePosition = new MobilePosition(); |
| | | mobilePosition.setCreateTime(DateUtil.getNow()); |
| | |
| | | String deviceId = SipUtils.getUserIdFromFromHeader(fromHeader); |
| | | |
| | | Element rootElement = getRootElement(evt); |
| | | if (rootElement == null) { |
| | | logger.error("处理alarm设备报警Notify时未获取到消息体{}", evt.getRequest()); |
| | | return; |
| | | } |
| | | Element deviceIdElement = rootElement.element("DeviceID"); |
| | | String channelId = deviceIdElement.getText().toString(); |
| | | |
| | |
| | | } |
| | | rootElement = getRootElement(evt, device.getCharset()); |
| | | if (rootElement == null) { |
| | | logger.warn("[ NotifyAlarm ] content cannot be null"); |
| | | logger.warn("[ NotifyAlarm ] content cannot be null, {}", evt.getRequest()); |
| | | return; |
| | | } |
| | | DeviceAlarm deviceAlarm = new DeviceAlarm(); |
| | |
| | | } |
| | | Element rootElement = getRootElement(evt, device.getCharset()); |
| | | if (rootElement == null) { |
| | | logger.warn("[ 收到目录订阅 ] content cannot be null"); |
| | | logger.warn("[ 收到目录订阅 ] content cannot be null, {}", evt.getRequest()); |
| | | return; |
| | | } |
| | | Element deviceListElement = rootElement.element("DeviceList"); |
| | |
| | | Request request = evt.getRequest(); |
| | | try { |
| | | Element rootElement = getRootElement(evt); |
| | | if (rootElement == null) { |
| | | logger.error("处理SUBSCRIBE请求 未获取到消息体{}", evt.getRequest()); |
| | | return; |
| | | } |
| | | String cmd = XmlUtil.getText(rootElement, "CmdType"); |
| | | if (CmdType.MOBILE_POSITION.equals(cmd)) { |
| | | processNotifyMobilePosition(evt, rootElement); |
| | |
| | | Element rootElement = null; |
| | | try { |
| | | rootElement = getRootElement(evt); |
| | | if (rootElement == null) { |
| | | logger.error("处理SUBSCRIBE请求 未获取到消息体{}", evt.getRequest()); |
| | | responseAck(evt, Response.BAD_REQUEST, "content is null"); |
| | | return; |
| | | } |
| | | } catch (DocumentException e) { |
| | | logger.warn("解析XML消息内容异常", e); |
| | | // 不存在则回复404 |
| | |
| | | try { |
| | | rootElement = getRootElement(evt, device.getCharset()); |
| | | if (rootElement == null) { |
| | | logger.warn("[ 移动设备位置数据通知 ] content cannot be null"); |
| | | logger.warn("[ 移动设备位置数据通知 ] content cannot be null, {}", evt.getRequest()); |
| | | responseAck(evt, Response.BAD_REQUEST); |
| | | return; |
| | | } |
| | |
| | | try { |
| | | Element rootElement = getRootElement(take.getEvt(), take.getDevice().getCharset()); |
| | | if (rootElement == null) { |
| | | logger.warn("[ 收到通道 ] content cannot be null"); |
| | | logger.warn("[ 收到通道 ] content cannot be null, {}", evt.getRequest()); |
| | | continue; |
| | | } |
| | | Element deviceListElement = rootElement.element("DeviceList"); |
| | |
| | | try { |
| | | rootElement = getRootElement(evt, device.getCharset()); |
| | | if (rootElement == null) { |
| | | logger.warn("[ 接收到DeviceInfo应答消息 ] content cannot be null"); |
| | | logger.warn("[ 接收到DeviceInfo应答消息 ] content cannot be null, {}", evt.getRequest()); |
| | | responseAck(evt, Response.BAD_REQUEST); |
| | | return; |
| | | } |
| | |
| | | try { |
| | | rootElement = getRootElement(evt, device.getCharset()); |
| | | if (rootElement == null) { |
| | | logger.warn("[ 移动设备位置数据查询回复 ] content cannot be null"); |
| | | logger.warn("[ 移动设备位置数据查询回复 ] content cannot be null, {}", evt.getRequest()); |
| | | responseAck(evt, Response.BAD_REQUEST); |
| | | return; |
| | | } |
| | |
| | | try { |
| | | rootElement = getRootElement(evt, device.getCharset()); |
| | | if (rootElement == null) { |
| | | logger.warn("[ 设备预置位查询应答 ] content cannot be null"); |
| | | logger.warn("[ 设备预置位查询应答 ] content cannot be null, {}", evt.getRequest()); |
| | | responseAck(evt, Response.BAD_REQUEST); |
| | | return; |
| | | } |
| | |
| | | HandlerCatchData take = taskQueue.poll(); |
| | | Element rootElementForCharset = getRootElement(take.getEvt(), take.getDevice().getCharset()); |
| | | if (rootElement == null) { |
| | | logger.warn("[ 国标录像 ] content cannot be null"); |
| | | logger.warn("[ 国标录像 ] content cannot be null, {}", evt.getRequest()); |
| | | continue; |
| | | } |
| | | String sn = getText(rootElementForCharset, "SN"); |