Merge branch 'wvp-28181-2.0' into 结构优化

# Conflicts:
#	src/main/java/com/genersoft/iot/vmp/gb28181/event/subscribe/catalog/CatalogEventLister.java
#	src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
#	src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java
结构优化
648540858 2024-01-12 14:20:01 +08:00
commit d287ff7763
5 changed files with 20 additions and 7 deletions

View File

@ -558,7 +558,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
.append("<CmdType>Catalog</CmdType>\r\n") .append("<CmdType>Catalog</CmdType>\r\n")
.append("<SN>" + SipUtils.getNewSn() + "</SN>\r\n") .append("<SN>" + SipUtils.getNewSn() + "</SN>\r\n")
.append("<DeviceID>" + parentPlatform.getDeviceGBId() + "</DeviceID>\r\n") .append("<DeviceID>" + parentPlatform.getDeviceGBId() + "</DeviceID>\r\n")
.append("<SumNum>"+ channels.size() +"</SumNum>\r\n") .append("<SumNum>"+ sumNum +"</SumNum>\r\n")
.append("<DeviceList Num=\"" + channels.size() + "\">\r\n"); .append("<DeviceList Num=\"" + channels.size() + "\">\r\n");
if (channels.size() > 0) { if (channels.size() > 0) {
for (CommonGbChannel channel : channels) { for (CommonGbChannel channel : channels) {

View File

@ -117,7 +117,7 @@ public class InviteStreamServiceImpl implements IInviteStreamService {
+ ":*"; + ":*";
List<Object> scanResult = RedisUtil.scan(redisTemplate, key); List<Object> scanResult = RedisUtil.scan(redisTemplate, key);
if (scanResult.size() != 1) { if (scanResult.size() != 1) {
return null; logger.warn("[获取InviteInfo] 发现 key: {}存在多条", key);
} }
return (InviteInfo) redisTemplate.opsForValue().get(scanResult.get(0)); return (InviteInfo) redisTemplate.opsForValue().get(scanResult.get(0));

View File

@ -702,6 +702,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
ssrcFactory.initMediaServerSSRC(mediaServerItem.getId(), null); ssrcFactory.initMediaServerSSRC(mediaServerItem.getId(), null);
String key = VideoManagerConstants.MEDIA_SERVER_PREFIX + userSetting.getServerId() + "_" + mediaServerItem.getId(); String key = VideoManagerConstants.MEDIA_SERVER_PREFIX + userSetting.getServerId() + "_" + mediaServerItem.getId();
redisTemplate.opsForValue().set(key, mediaServerItem); redisTemplate.opsForValue().set(key, mediaServerItem);
resetOnlineServerItem(mediaServerItem);
clearRTPServer(mediaServerItem); clearRTPServer(mediaServerItem);
} }
final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + mediaServerItem.getId(); final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + mediaServerItem.getId();

View File

@ -262,6 +262,7 @@ public class PlatformServiceImpl implements IPlatformService {
} }
if (parentPlatform.isAutoPushChannel()) { if (parentPlatform.isAutoPushChannel()) {
if (subscribeHolder.getCatalogSubscribe(parentPlatform.getId()) == null) { if (subscribeHolder.getCatalogSubscribe(parentPlatform.getId()) == null) {
logger.info("[国标级联]{}, 添加自动通道推送模拟订阅信息", parentPlatform.getServerGBId());
addSimulatedSubscribeInfo(parentPlatform); addSimulatedSubscribeInfo(parentPlatform);
} }
}else { }else {
@ -331,9 +332,16 @@ public class PlatformServiceImpl implements IPlatformService {
// 清除心跳任务 // 清除心跳任务
dynamicTask.stop(keepaliveTaskKey); dynamicTask.stop(keepaliveTaskKey);
} }
// 停止目录订阅回复 // 停止订阅回复
logger.info("[平台离线] {}, 停止订阅回复", parentPlatform.getServerGBId()); SubscribeInfo catalogSubscribe = subscribeHolder.getCatalogSubscribe(parentPlatform.getId());
subscribeHolder.removeAllSubscribe(parentPlatform.getId()); if (catalogSubscribe != null) {
if (catalogSubscribe.getExpires() > 0) {
logger.info("[平台离线] {}, 停止目录订阅回复", parentPlatform.getServerGBId());
subscribeHolder.removeCatalogSubscribe(parentPlatform.getId());
}
}
logger.info("[平台离线] {}, 停止移动位置订阅回复", parentPlatform.getServerGBId());
subscribeHolder.removeMobilePositionSubscribe(parentPlatform.getId());
// 发起定时自动重新注册 // 发起定时自动重新注册
if (!stopRegister) { if (!stopRegister) {
// 设置为60秒自动尝试重新注册 // 设置为60秒自动尝试重新注册

View File

@ -981,7 +981,9 @@ public class PlayServiceImpl implements IPlayService {
throw new ServiceException("mediaServer不存在"); throw new ServiceException("mediaServer不存在");
} }
// zlm 暂停RTP超时检查 // zlm 暂停RTP超时检查
JSONObject jsonObject = zlmresTfulUtils.pauseRtpCheck(mediaServerItem, streamId); // 使用zlm中的流ID
String ssrc = Long.toHexString(Long.parseLong(ssrcTransaction.getSsrc())).toUpperCase();
JSONObject jsonObject = zlmresTfulUtils.pauseRtpCheck(mediaServerItem, ssrc);
if (jsonObject == null || jsonObject.getInteger("code") != 0) { if (jsonObject == null || jsonObject.getInteger("code") != 0) {
logger.warn("[暂停流] 暂停RTP接收失败 {}", jsonObject ); logger.warn("[暂停流] 暂停RTP接收失败 {}", jsonObject );
throw new ServiceException("暂停RTP接收失败"); throw new ServiceException("暂停RTP接收失败");
@ -1006,7 +1008,9 @@ public class PlayServiceImpl implements IPlayService {
} }
// zlm 暂停RTP超时检查 // zlm 暂停RTP超时检查
JSONObject jsonObject = zlmresTfulUtils.resumeRtpCheck(mediaServerItem, streamId); // 使用zlm中的流ID
String ssrc = Long.toHexString(Long.parseLong(ssrcTransaction.getSsrc())).toUpperCase();
JSONObject jsonObject = zlmresTfulUtils.resumeRtpCheck(mediaServerItem, ssrc);
if (jsonObject == null || jsonObject.getInteger("code") != 0) { if (jsonObject == null || jsonObject.getInteger("code") != 0) {
logger.info("[暂停RTP超时检查] 失败:" + jsonObject); logger.info("[暂停RTP超时检查] 失败:" + jsonObject);
throw new ServiceException("继续RTP接收失败"); throw new ServiceException("继续RTP接收失败");