优化对海康平台的兼容性

This commit is contained in:
648540858
2023-03-17 17:08:37 +08:00
parent d3027b0668
commit 782300452c
4 changed files with 25 additions and 2 deletions

View File

@@ -50,6 +50,8 @@ public class UserSetting {
private Boolean sipLog = Boolean.FALSE;
private Boolean sendToPlatformsWhenIdLost = Boolean.FALSE;
private Boolean refuseChannelStatusChannelFormNotify = Boolean.FALSE;
private String serverId = "000000";
private String thirdPartyGBIdReg = "[\\s\\S]*";
@@ -237,4 +239,14 @@ public class UserSetting {
public void setSendToPlatformsWhenIdLost(Boolean sendToPlatformsWhenIdLost) {
this.sendToPlatformsWhenIdLost = sendToPlatformsWhenIdLost;
}
public Boolean getRefuseChannelStatusChannelFormNotify() {
return refuseChannelStatusChannelFormNotify;
}
public void setRefuseChannelStatusChannelFormNotify(Boolean refuseChannelStatusChannelFormNotify) {
this.refuseChannelStatusChannelFormNotify = refuseChannelStatusChannelFormNotify;
}
}

View File

@@ -393,12 +393,20 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements
case CatalogEvent.OFF :
// 离线
logger.info("[收到通道离线通知] 来自设备: {}, 通道 {}", device.getDeviceId(), channel.getChannelId());
storager.deviceChannelOffline(deviceId, channel.getChannelId());
if (userSetting.getRefuseChannelStatusChannelFormNotify()) {
storager.deviceChannelOffline(deviceId, channel.getChannelId());
}else {
logger.info("[收到通道离线通知] 但是平台已配置拒绝此消息,来自设备: {}, 通道 {}", device.getDeviceId(), channel.getChannelId());
}
break;
case CatalogEvent.VLOST:
// 视频丢失
logger.info("[收到通道视频丢失通知] 来自设备: {}, 通道 {}", device.getDeviceId(), channel.getChannelId());
storager.deviceChannelOffline(deviceId, channel.getChannelId());
if (userSetting.getRefuseChannelStatusChannelFormNotify()) {
storager.deviceChannelOffline(deviceId, channel.getChannelId());
}else {
logger.info("[收到通道视频丢失通知] 但是平台已配置拒绝此消息,来自设备: {}, 通道 {}", device.getDeviceId(), channel.getChannelId());
}
break;
case CatalogEvent.DEFECT:
// 故障

View File

@@ -857,6 +857,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
@Override
public void sendAlarmMsg(AlarmChannelMessage msg) {
// 此消息用于对接第三方服务下级来的消息内容
String key = VideoManagerConstants.VM_MSG_SUBSCRIBE_ALARM;
logger.info("[redis发送通知] 报警{}: {}", key, JSON.toJSON(msg));
RedisUtil.convertAndSend(key, (JSONObject)JSON.toJSON(msg));