mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-26 23:17:50 +08:00
修复合并PR时的数据导入问题
This commit is contained in:
parent
2e149dc2a2
commit
c35bb73091
@ -121,8 +121,9 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||
public void process(RequestEvent evt) {
|
||||
|
||||
SIPRequest request = (SIPRequest) evt.getRequest();
|
||||
InviteMessageInfo inviteInfo = null;
|
||||
try {
|
||||
InviteMessageInfo inviteInfo = decode(evt);
|
||||
inviteInfo = decode(evt);
|
||||
|
||||
// 查询请求是否来自上级平台\设备
|
||||
Platform platform = platformService.queryPlatformByServerGBId(inviteInfo.getRequesterId());
|
||||
@ -162,6 +163,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||
log.error("[命令发送失败] 上级INVITE TRYING: {}", e.getMessage());
|
||||
}
|
||||
|
||||
InviteMessageInfo finalInviteInfo = inviteInfo;
|
||||
channelPlayService.startInvite(channel, inviteInfo, platform, ((code, msg, streamInfo) -> {
|
||||
if (code != InviteErrorCode.SUCCESS.getCode()) {
|
||||
try {
|
||||
@ -175,40 +177,40 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||
// 上级平台点播时不使用上级平台指定的ssrc,使用自定义的ssrc,参考国标文档-点播外域设备媒体流SSRC处理方式
|
||||
MediaServer mediaServer = mediaServerService.getOne(streamInfo.getMediaServer().getId());
|
||||
if (mediaServer != null) {
|
||||
String ssrc = "Play".equalsIgnoreCase(inviteInfo.getSessionName())
|
||||
String ssrc = "Play".equalsIgnoreCase(finalInviteInfo.getSessionName())
|
||||
? ssrcFactory.getPlaySsrc(streamInfo.getMediaServer().getId())
|
||||
: ssrcFactory.getPlayBackSsrc(streamInfo.getMediaServer().getId());
|
||||
inviteInfo.setSsrc(ssrc);
|
||||
inviteInfo.setAllocatedSsrc(ssrc);
|
||||
inviteInfo.setAllocatedSsrcMediaServerId(streamInfo.getMediaServer().getId());
|
||||
finalInviteInfo.setSsrc(ssrc);
|
||||
finalInviteInfo.setAllocatedSsrc(ssrc);
|
||||
finalInviteInfo.setAllocatedSsrcMediaServerId(streamInfo.getMediaServer().getId());
|
||||
}
|
||||
}
|
||||
// 构建sendRTP内容
|
||||
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(),
|
||||
channel.getGbId(), inviteInfo.isTcp(), platform.isRtcp());
|
||||
sendRtpItem.setAllocatedSsrc(inviteInfo.getAllocatedSsrc());
|
||||
if (inviteInfo.isTcp() && inviteInfo.isTcpActive()) {
|
||||
channel.getGbId(), finalInviteInfo.isTcp(), platform.isRtcp());
|
||||
sendRtpItem.setAllocatedSsrc(finalInviteInfo.getAllocatedSsrc());
|
||||
if (finalInviteInfo.isTcp() && finalInviteInfo.isTcpActive()) {
|
||||
sendRtpItem.setTcpActive(true);
|
||||
}
|
||||
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());
|
||||
sendRtpServerService.update(sendRtpItem);
|
||||
String sdpIp = streamInfo.getMediaServer().getSdpIp();
|
||||
if (!ObjectUtils.isEmpty(platform.getSendStreamIp())) {
|
||||
sdpIp = platform.getSendStreamIp();
|
||||
}
|
||||
String content = createSendSdp(sendRtpItem, inviteInfo, sdpIp);
|
||||
String content = createSendSdp(sendRtpItem, finalInviteInfo, sdpIp);
|
||||
// 超时未收到Ack应该回复bye,当前等待时间为10秒
|
||||
dynamicTask.startDelay(inviteInfo.getCallId(), () -> {
|
||||
log.info("[Ack ] 等待超时, {}/{}", inviteInfo.getCallId(), channel.getGbDeviceId());
|
||||
dynamicTask.startDelay(finalInviteInfo.getCallId(), () -> {
|
||||
log.info("[Ack ] 等待超时, {}/{}", finalInviteInfo.getCallId(), channel.getGbDeviceId());
|
||||
mediaServerService.releaseSsrc(streamInfo.getMediaServer().getId(), sendRtpItem.getSsrcToRelease());
|
||||
// 回复bye
|
||||
sendBye(platform, inviteInfo.getCallId());
|
||||
sendBye(platform, finalInviteInfo.getCallId());
|
||||
}, 60 * 1000);
|
||||
try {
|
||||
responseSdpAck(request, content, platform);
|
||||
@ -227,7 +229,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||
}
|
||||
} catch (ControllerException e) {
|
||||
log.warn("[上级INVITE] tcp主动模式 发流失败", e);
|
||||
sendBye(platform, inviteInfo.getCallId());
|
||||
sendBye(platform, finalInviteInfo.getCallId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user