修复bug与目录订阅添加最小值60

This commit is contained in:
648540858
2022-01-19 10:23:52 +08:00
parent 9be861abcc
commit e8090bc84c
7 changed files with 38 additions and 29 deletions

View File

@@ -62,6 +62,7 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> {
if (!parentPlatform.isStatus())return;
String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetup.getServerId() + "_Catalog_" + event.getPlatformId();
subscribe = redisCatchStorage.getSubscribe(key);
if (subscribe == null) return;
}else {
// 获取所用订阅
List<String> platforms = redisCatchStorage.getAllSubscribePlatform();
@@ -107,9 +108,10 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> {
List<ParentPlatform> parentPlatforms = parentPlatformMap.get(gbId);
if (parentPlatforms != null && parentPlatforms.size() > 0) {
for (ParentPlatform platform : parentPlatforms) {
logger.info("[Catalog事件: {}]平台:{},影响通道{}", event.getType(), platform.getServerGBId(), gbId);
String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetup.getServerId() + "_Catalog_" + platform.getServerGBId();
SubscribeInfo subscribeInfo = redisCatchStorage.getSubscribe(key);
if (subscribeInfo == null) continue;
logger.info("[Catalog事件: {}]平台:{},影响通道{}", event.getType(), platform.getServerGBId(), gbId);
List<DeviceChannel> deviceChannelList = new ArrayList<>();
DeviceChannel deviceChannel = new DeviceChannel();
deviceChannel.setChannelId(gbId);
@@ -146,9 +148,10 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> {
List<ParentPlatform> parentPlatforms = parentPlatformMap.get(gbId);
if (parentPlatforms != null && parentPlatforms.size() > 0) {
for (ParentPlatform platform : parentPlatforms) {
logger.info("[Catalog事件: {}]平台:{},影响通道{}", event.getType(), platform.getServerGBId(), gbId);
String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetup.getServerId() + "_Catalog_" + platform.getServerGBId();
SubscribeInfo subscribeInfo = redisCatchStorage.getSubscribe(key);
if (subscribeInfo == null) continue;
logger.info("[Catalog事件: {}]平台:{},影响通道{}", event.getType(), platform.getServerGBId(), gbId);
List<DeviceChannel> deviceChannelList = new ArrayList<>();
DeviceChannel deviceChannel = storager.queryChannelInParentPlatform(platform.getServerGBId(), gbId);
deviceChannelList.add(deviceChannel);

View File

@@ -1498,7 +1498,10 @@ public class SIPCommander implements ISIPCommander {
CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId()
: udpSipProvider.getNewCallId();
Request request = headerProvider.createSubscribeRequest(device, cmdXml.toString(), "z9hG4bK-viaPos-" + tm, "fromTagPos" + tm, null, device.getSubscribeCycleForCatalog(), "Catalog" , callIdHeader);
// 有效时间默认为60秒以上
Request request = headerProvider.createSubscribeRequest(device, cmdXml.toString(), "z9hG4bK-viaPos-" + tm,
"fromTagPos" + tm, null, device.getSubscribeCycleForCatalog() + 60, "Catalog" ,
callIdHeader);
transmitRequest(device, request, errorEvent, okEvent);
return true;

View File

@@ -370,10 +370,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
@Override
public boolean sendNotifyForCatalogAddOrUpdate(String type, ParentPlatform parentPlatform, List<DeviceChannel> deviceChannels, SubscribeInfo subscribeInfo) {
if (parentPlatform == null) {
return false;
}
if (deviceChannels == null || deviceChannels.size() == 0) {
if (parentPlatform == null || deviceChannels == null || deviceChannels.size() == 0 || subscribeInfo == null) {
return false;
}
for (DeviceChannel channel : deviceChannels) {
@@ -431,10 +428,10 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
@Override
public boolean sendNotifyForCatalogOther(String type, ParentPlatform parentPlatform, List<DeviceChannel> deviceChannels, SubscribeInfo subscribeInfo) {
if (parentPlatform == null) {
return false;
}
if (deviceChannels == null || deviceChannels.size() == 0) {
if (parentPlatform == null
|| deviceChannels == null
|| deviceChannels.size() == 0
|| subscribeInfo == null) {
return false;
}