修复合并PR时的数据导入问题

This commit is contained in:
lin 2026-04-13 11:05:45 +08:00
parent 2e149dc2a2
commit c35bb73091

View File

@ -121,8 +121,9 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
public void process(RequestEvent evt) { public void process(RequestEvent evt) {
SIPRequest request = (SIPRequest) evt.getRequest(); SIPRequest request = (SIPRequest) evt.getRequest();
InviteMessageInfo inviteInfo = null;
try { try {
InviteMessageInfo inviteInfo = decode(evt); inviteInfo = decode(evt);
// 查询请求是否来自上级平台\设备 // 查询请求是否来自上级平台\设备
Platform platform = platformService.queryPlatformByServerGBId(inviteInfo.getRequesterId()); Platform platform = platformService.queryPlatformByServerGBId(inviteInfo.getRequesterId());
@ -162,6 +163,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
log.error("[命令发送失败] 上级INVITE TRYING: {}", e.getMessage()); log.error("[命令发送失败] 上级INVITE TRYING: {}", e.getMessage());
} }
InviteMessageInfo finalInviteInfo = inviteInfo;
channelPlayService.startInvite(channel, inviteInfo, platform, ((code, msg, streamInfo) -> { channelPlayService.startInvite(channel, inviteInfo, platform, ((code, msg, streamInfo) -> {
if (code != InviteErrorCode.SUCCESS.getCode()) { if (code != InviteErrorCode.SUCCESS.getCode()) {
try { try {
@ -175,40 +177,40 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
// 上级平台点播时不使用上级平台指定的ssrc使用自定义的ssrc参考国标文档-点播外域设备媒体流SSRC处理方式 // 上级平台点播时不使用上级平台指定的ssrc使用自定义的ssrc参考国标文档-点播外域设备媒体流SSRC处理方式
MediaServer mediaServer = mediaServerService.getOne(streamInfo.getMediaServer().getId()); MediaServer mediaServer = mediaServerService.getOne(streamInfo.getMediaServer().getId());
if (mediaServer != null) { if (mediaServer != null) {
String ssrc = "Play".equalsIgnoreCase(inviteInfo.getSessionName()) String ssrc = "Play".equalsIgnoreCase(finalInviteInfo.getSessionName())
? ssrcFactory.getPlaySsrc(streamInfo.getMediaServer().getId()) ? ssrcFactory.getPlaySsrc(streamInfo.getMediaServer().getId())
: ssrcFactory.getPlayBackSsrc(streamInfo.getMediaServer().getId()); : ssrcFactory.getPlayBackSsrc(streamInfo.getMediaServer().getId());
inviteInfo.setSsrc(ssrc); finalInviteInfo.setSsrc(ssrc);
inviteInfo.setAllocatedSsrc(ssrc); finalInviteInfo.setAllocatedSsrc(ssrc);
inviteInfo.setAllocatedSsrcMediaServerId(streamInfo.getMediaServer().getId()); finalInviteInfo.setAllocatedSsrcMediaServerId(streamInfo.getMediaServer().getId());
} }
} }
// 构建sendRTP内容 // 构建sendRTP内容
SendRtpInfo sendRtpItem = sendRtpServerService.createSendRtpInfo(streamInfo.getMediaServer(), SendRtpInfo sendRtpItem = sendRtpServerService.createSendRtpInfo(streamInfo.getMediaServer(),
inviteInfo.getIp(), inviteInfo.getPort(), inviteInfo.getSsrc(), platform.getServerGBId(), finalInviteInfo.getIp(), finalInviteInfo.getPort(), finalInviteInfo.getSsrc(), platform.getServerGBId(),
streamInfo.getApp(), streamInfo.getStream(), streamInfo.getApp(), streamInfo.getStream(),
channel.getGbId(), inviteInfo.isTcp(), platform.isRtcp()); channel.getGbId(), finalInviteInfo.isTcp(), platform.isRtcp());
sendRtpItem.setAllocatedSsrc(inviteInfo.getAllocatedSsrc()); sendRtpItem.setAllocatedSsrc(finalInviteInfo.getAllocatedSsrc());
if (inviteInfo.isTcp() && inviteInfo.isTcpActive()) { if (finalInviteInfo.isTcp() && finalInviteInfo.isTcpActive()) {
sendRtpItem.setTcpActive(true); sendRtpItem.setTcpActive(true);
} }
sendRtpItem.setStatus(1); sendRtpItem.setStatus(1);
sendRtpItem.setCallId(inviteInfo.getCallId()); sendRtpItem.setCallId(finalInviteInfo.getCallId());
sendRtpItem.setPlayTypeByChannelDataType(channel.getDataType(), inviteInfo.getSessionName()); sendRtpItem.setPlayTypeByChannelDataType(channel.getDataType(), finalInviteInfo.getSessionName());
sendRtpItem.setServerId(streamInfo.getServerId()); sendRtpItem.setServerId(streamInfo.getServerId());
sendRtpServerService.update(sendRtpItem); sendRtpServerService.update(sendRtpItem);
String sdpIp = streamInfo.getMediaServer().getSdpIp(); String sdpIp = streamInfo.getMediaServer().getSdpIp();
if (!ObjectUtils.isEmpty(platform.getSendStreamIp())) { if (!ObjectUtils.isEmpty(platform.getSendStreamIp())) {
sdpIp = platform.getSendStreamIp(); sdpIp = platform.getSendStreamIp();
} }
String content = createSendSdp(sendRtpItem, inviteInfo, sdpIp); String content = createSendSdp(sendRtpItem, finalInviteInfo, sdpIp);
// 超时未收到Ack应该回复bye,当前等待时间为10秒 // 超时未收到Ack应该回复bye,当前等待时间为10秒
dynamicTask.startDelay(inviteInfo.getCallId(), () -> { dynamicTask.startDelay(finalInviteInfo.getCallId(), () -> {
log.info("[Ack ] 等待超时, {}/{}", inviteInfo.getCallId(), channel.getGbDeviceId()); log.info("[Ack ] 等待超时, {}/{}", finalInviteInfo.getCallId(), channel.getGbDeviceId());
mediaServerService.releaseSsrc(streamInfo.getMediaServer().getId(), sendRtpItem.getSsrcToRelease()); mediaServerService.releaseSsrc(streamInfo.getMediaServer().getId(), sendRtpItem.getSsrcToRelease());
// 回复bye // 回复bye
sendBye(platform, inviteInfo.getCallId()); sendBye(platform, finalInviteInfo.getCallId());
}, 60 * 1000); }, 60 * 1000);
try { try {
responseSdpAck(request, content, platform); responseSdpAck(request, content, platform);
@ -227,7 +229,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
} }
} catch (ControllerException e) { } catch (ControllerException e) {
log.warn("[上级INVITE] tcp主动模式 发流失败", e); log.warn("[上级INVITE] tcp主动模式 发流失败", e);
sendBye(platform, inviteInfo.getCallId()); sendBye(platform, finalInviteInfo.getCallId());
} }
} }
} }