Merge remote-tracking branch 'origin/dev/master-通道结构重构' into dev/master-通道结构重构

This commit is contained in:
648540858
2024-08-12 09:55:10 +08:00
83 changed files with 747 additions and 787 deletions

View File

@@ -234,7 +234,7 @@ public class MediaServiceImpl implements IMediaService {
inviteInfo.getChannelId());
if (!sendRtpItems.isEmpty()) {
for (SendRtpItem sendRtpItem : sendRtpItems) {
ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId());
Platform parentPlatform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId());
try {
commanderForPlatform.streamByeCmd(parentPlatform, sendRtpItem.getCallId());
} catch (SipException | InvalidArgumentException | ParseException e) {
@@ -248,7 +248,7 @@ public class MediaServiceImpl implements IMediaService {
}
}
}
Device device = deviceService.getDevice(inviteInfo.getDeviceId());
Device device = deviceService.getDeviceByDeviceId(inviteInfo.getDeviceId());
if (device != null) {
try {
// 多查询一次防止已经被处理了

View File

@@ -5,7 +5,7 @@ import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.gb28181.bean.AlarmChannelMessage;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService;
@@ -89,9 +89,9 @@ public class RedisAlarmMsgListener implements MessageListener {
if (ObjectUtils.isEmpty(gbId)) {
if (userSetting.getSendToPlatformsWhenIdLost()) {
// 发送给所有的上级
List<ParentPlatform> parentPlatforms = storage.queryEnableParentPlatformList(true);
List<Platform> parentPlatforms = storage.queryEnableParentPlatformList(true);
if (parentPlatforms.size() > 0) {
for (ParentPlatform parentPlatform : parentPlatforms) {
for (Platform parentPlatform : parentPlatforms) {
try {
deviceAlarm.setChannelId(parentPlatform.getDeviceGBId());
commanderForPlatform.sendAlarmMessage(parentPlatform, deviceAlarm);
@@ -102,9 +102,9 @@ public class RedisAlarmMsgListener implements MessageListener {
}
}else {
// 获取开启了消息推送的设备和平台
List<ParentPlatform> parentPlatforms = storage.queryEnablePlatformListWithAsMessageChannel();
List<Platform> parentPlatforms = storage.queryEnablePlatformListWithAsMessageChannel();
if (parentPlatforms.size() > 0) {
for (ParentPlatform parentPlatform : parentPlatforms) {
for (Platform parentPlatform : parentPlatforms) {
try {
deviceAlarm.setChannelId(parentPlatform.getDeviceGBId());
commanderForPlatform.sendAlarmMessage(parentPlatform, deviceAlarm);
@@ -129,8 +129,8 @@ public class RedisAlarmMsgListener implements MessageListener {
}
}else {
Device device = deviceService.getDevice(gbId);
ParentPlatform platform = storage.queryParentPlatByServerGBId(gbId);
Device device = deviceService.getDeviceByDeviceId(gbId);
Platform platform = storage.queryParentPlatByServerGBId(gbId);
if (device != null && platform == null) {
try {
commander.sendAlarmMessage(device, deviceAlarm);

View File

@@ -8,7 +8,7 @@ import com.genersoft.iot.vmp.conf.redis.RedisRpcConfig;
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcMessage;
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcRequest;
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcResponse;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
import com.genersoft.iot.vmp.gb28181.session.SSRCFactory;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
@@ -317,7 +317,7 @@ public class RedisRpcController {
}
log.info("[redis-rpc] 推流已经停止: {}/{}, 目标地址: {}{}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort() );
String platformId = sendRtpItem.getPlatformId();
ParentPlatform platform = storager.queryParentPlatByServerGBId(platformId);
Platform platform = storager.queryParentPlatByServerGBId(platformId);
if (platform == null) {
return response;
}