| | |
| | | * @param endTime 报警发生终止时间(可选)
|
| | | * @return true = 命令发送成功
|
| | | */
|
| | | void alarmSubscribe(Device device, int expires, String startPriority, String endPriority, String alarmMethod, String alarmType, String startTime, String endTime) throws InvalidArgumentException, SipException, ParseException;
|
| | | void alarmSubscribe(Device device, int expires, String startPriority, String endPriority, String alarmMethod, String startTime, String endTime) throws InvalidArgumentException, SipException, ParseException;
|
| | |
|
| | | /**
|
| | | * 订阅、取消订阅目录信息
|
| | |
| | | * @return true = 命令发送成功
|
| | | */
|
| | | @Override
|
| | | public void alarmSubscribe(Device device, int expires, String startPriority, String endPriority, String alarmMethod, String alarmType, String startTime, String endTime) throws InvalidArgumentException, SipException, ParseException {
|
| | | public void alarmSubscribe(Device device, int expires, String startPriority, String endPriority, String alarmMethod, String startTime, String endTime) throws InvalidArgumentException, SipException, ParseException {
|
| | |
|
| | | StringBuffer cmdXml = new StringBuffer(200);
|
| | | String charset = device.getCharset();
|
| | |
| | | }
|
| | | if (!ObjectUtils.isEmpty(alarmMethod)) {
|
| | | cmdXml.append("<AlarmMethod>" + alarmMethod + "</AlarmMethod>\r\n");
|
| | | }
|
| | | if (!ObjectUtils.isEmpty(alarmType)) {
|
| | | cmdXml.append("<AlarmType>" + alarmType + "</AlarmType>\r\n");
|
| | | }
|
| | | if (!ObjectUtils.isEmpty(startTime)) {
|
| | | cmdXml.append("<StartAlarmTime>" + startTime + "</StartAlarmTime>\r\n");
|
| | |
| | | redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), null, true); |
| | | } |
| | | |
| | | // |
| | | // try { |
| | | // cmder.alarmSubscribe(device, 600, "0", "4", "0", "2023-7-27T00:00:00", "2023-7-28T00:00:00"); |
| | | // } catch (InvalidArgumentException e) { |
| | | // throw new RuntimeException(e); |
| | | // } catch (SipException e) { |
| | | // throw new RuntimeException(e); |
| | | // } catch (ParseException e) { |
| | | // throw new RuntimeException(e); |
| | | // } |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | @PostMapping(value = "/test/getPort") |
| | | @ResponseBody |
| | | public int getPort() { |
| | | int result = sendRtpPortManager.getNextPort(mediaServerService.getDefaultMediaServer()); |
| | | System.out.println(result); |
| | | return result; |
| | | } |
| | | } |