兼容设备
parent
4eac6dcc94
commit
617c407318
|
@ -901,9 +901,35 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
|
|
||||||
public void inviteFromDeviceHandle(SIPRequest request, String requesterId, String channelId) {
|
public void inviteFromDeviceHandle(SIPRequest request, String requesterId, String channelId) {
|
||||||
|
|
||||||
|
String realChannelId = null;
|
||||||
|
|
||||||
// 非上级平台请求,查询是否设备请求(通常为接收语音广播的设备)
|
// 非上级平台请求,查询是否设备请求(通常为接收语音广播的设备)
|
||||||
Device device = redisCatchStorage.getDevice(requesterId);
|
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) {
|
if (broadcastCatch == null) {
|
||||||
logger.warn("来自设备的Invite请求非语音广播,已忽略,requesterId: {}/{}", requesterId, channelId);
|
logger.warn("来自设备的Invite请求非语音广播,已忽略,requesterId: {}/{}", requesterId, channelId);
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -498,7 +498,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
// 检查是否有y字段
|
// 检查是否有y字段
|
||||||
if (ssrcIndex >= 0) {
|
if (ssrcIndex >= 0) {
|
||||||
//ssrc规定长度为10字节,不取余下长度以避免后续还有“f=”字段 TODO 后续对不规范的非10位ssrc兼容
|
//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校验则需要针对处理
|
// 查询到ssrc不一致且开启了ssrc校验则需要针对处理
|
||||||
if (ssrcInfo.getSsrc().equals(ssrcInResponse)) {
|
if (ssrcInfo.getSsrc().equals(ssrcInResponse)) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue