| | |
| | | * @param endTime 结束时间,格式要求:yyyy-MM-dd HH:mm:ss
|
| | | */
|
| | | @Override
|
| | | public boolean recordInfoQuery(Device device, String channelId, String startTime, String endTime, int sn, SipSubscribe.Event errorEvent) {
|
| | |
|
| | | public boolean recordInfoQuery(Device device, String channelId, String startTime, String endTime, int sn, Integer secrecy, String type, SipSubscribe.Event okEvent, SipSubscribe.Event errorEvent) {
|
| | | if (secrecy == null) {
|
| | | secrecy = 0;
|
| | | }
|
| | | if (type == null) {
|
| | | type = "all";
|
| | | }
|
| | |
|
| | | try {
|
| | | StringBuffer recordInfoXml = new StringBuffer(200);
|
| | |
| | | recordInfoXml.append("<DeviceID>" + channelId + "</DeviceID>\r\n");
|
| | | recordInfoXml.append("<StartTime>" + DateUtil.yyyy_MM_dd_HH_mm_ssToISO8601(startTime) + "</StartTime>\r\n");
|
| | | recordInfoXml.append("<EndTime>" + DateUtil.yyyy_MM_dd_HH_mm_ssToISO8601(endTime) + "</EndTime>\r\n");
|
| | | recordInfoXml.append("<Secrecy>0</Secrecy>\r\n");
|
| | | recordInfoXml.append("<Secrecy> "+ secrecy + " </Secrecy>\r\n");
|
| | | // 大华NVR要求必须增加一个值为all的文本元素节点Type
|
| | | recordInfoXml.append("<Type>all</Type>\r\n");
|
| | | recordInfoXml.append("<Type>" + type+"</Type>\r\n");
|
| | | recordInfoXml.append("</Query>\r\n");
|
| | |
|
| | | String tm = Long.toString(System.currentTimeMillis());
|
| | |
| | | Request request = headerProvider.createMessageRequest(device, recordInfoXml.toString(),
|
| | | "z9hG4bK-ViaRecordInfo-" + tm, "fromRec" + tm, null, callIdHeader);
|
| | |
|
| | | transmitRequest(device, request, errorEvent);
|
| | | transmitRequest(device, request, errorEvent, okEvent);
|
| | | } catch (SipException | ParseException | InvalidArgumentException e) {
|
| | | e.printStackTrace();
|
| | | return false;
|
| | |
| | | content.append("CSeq: " + cseq + "\r\n");
|
| | | content.append("PauseTime: now\r\n");
|
| | | Request request = headerProvider.createInfoRequest(device, streamInfo, content.toString(), cseq);
|
| | | if (request == null) {
|
| | | return;
|
| | | }
|
| | | logger.info(request.toString());
|
| | | ClientTransaction clientTransaction = null;
|
| | | if ("TCP".equals(device.getTransport())) {
|
| | |
| | | content.append("CSeq: " + cseq + "\r\n");
|
| | | content.append("Range: npt=now-\r\n");
|
| | | Request request = headerProvider.createInfoRequest(device, streamInfo, content.toString(), cseq);
|
| | | if (request == null) return;
|
| | | logger.info(request.toString());
|
| | | ClientTransaction clientTransaction = null;
|
| | | if ("TCP".equals(device.getTransport())) {
|
| | |
| | | content.append("Range: npt=" + Math.abs(seekTime) + "-\r\n");
|
| | |
|
| | | Request request = headerProvider.createInfoRequest(device, streamInfo, content.toString(), cseq);
|
| | | if (request == null) return;
|
| | | logger.info(request.toString());
|
| | | ClientTransaction clientTransaction = null;
|
| | | if ("TCP".equals(device.getTransport())) {
|
| | |
| | | content.append("CSeq: " + cseq + "\r\n");
|
| | | content.append("Scale: " + String.format("%.1f",speed) + "\r\n");
|
| | | Request request = headerProvider.createInfoRequest(device, streamInfo, content.toString(), cseq);
|
| | | if (request == null) return;
|
| | | logger.info(request.toString());
|
| | | ClientTransaction clientTransaction = null;
|
| | | if ("TCP".equals(device.getTransport())) {
|