Merge branch 'main' into main-dev

结构优化
648540858 2023-04-03 18:39:29 +08:00
commit 786c76ba71
2 changed files with 28 additions and 2 deletions

View File

@ -901,9 +901,35 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
public void inviteFromDeviceHandle(SIPRequest request, String requesterId, String channelId) {
String realChannelId = null;
// 非上级平台请求,查询是否设备请求(通常为接收语音广播的设备)
Device device = redisCatchStorage.getDevice(requesterId);
AudioBroadcastCatch broadcastCatch = audioBroadcastManager.get(requesterId, channelId);
// 判断requesterId是设备还是通道
if (device == null) {
device = storager.queryVideoDeviceByChannelId(requesterId);
realChannelId = requesterId;
}
if (device == null) {
// 检查channelID是否可用
device = redisCatchStorage.getDevice(channelId);
if (device == null) {
device = storager.queryVideoDeviceByChannelId(channelId);
realChannelId = channelId;
}
}
if (device == null) {
logger.warn("来自设备的Invite请求无法从请求信息中确定所属设备已忽略requesterId {}/{}", requesterId, channelId);
try {
responseAck(request, Response.FORBIDDEN);
} catch (SipException | InvalidArgumentException | ParseException e) {
logger.error("[命令发送失败] 来自设备的Invite请求无法从请求信息中确定所属设备 FORBIDDEN: {}", e.getMessage());
}
return;
}
AudioBroadcastCatch broadcastCatch = audioBroadcastManager.get(device.getDeviceId(), realChannelId);
if (broadcastCatch == null) {
logger.warn("来自设备的Invite请求非语音广播已忽略requesterId {}/{}", requesterId, channelId);
try {

View File

@ -453,7 +453,7 @@ public class PlayServiceImpl implements IPlayService {
// 检查是否有y字段
if (ssrcIndex >= 0) {
//ssrc规定长度为10字节不取余下长度以避免后续还有“f=”字段 TODO 后续对不规范的非10位ssrc兼容
String ssrcInResponse = contentString.substring(ssrcIndex + 2, ssrcIndex + 12);
String ssrcInResponse = contentString.substring(ssrcIndex + 2, ssrcIndex + 12).trim();
// 查询到ssrc不一致且开启了ssrc校验则需要针对处理
if (ssrcInfo.getSsrc().equals(ssrcInResponse)) {
return;