Commit 786c76ba714321c2d481b32afbb619a33f7c11a9
Merge branch 'main' into main-dev
Showing
2 changed files
with
28 additions
and
2 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
| ... | ... | @@ -901,9 +901,35 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements |
| 901 | 901 | |
| 902 | 902 | public void inviteFromDeviceHandle(SIPRequest request, String requesterId, String channelId) { |
| 903 | 903 | |
| 904 | + String realChannelId = null; | |
| 905 | + | |
| 904 | 906 | // 非上级平台请求,查询是否设备请求(通常为接收语音广播的设备) |
| 905 | 907 | Device device = redisCatchStorage.getDevice(requesterId); |
| 906 | - AudioBroadcastCatch broadcastCatch = audioBroadcastManager.get(requesterId, channelId); | |
| 908 | + // 判断requesterId是设备还是通道 | |
| 909 | + if (device == null) { | |
| 910 | + device = storager.queryVideoDeviceByChannelId(requesterId); | |
| 911 | + realChannelId = requesterId; | |
| 912 | + } | |
| 913 | + if (device == null) { | |
| 914 | + // 检查channelID是否可用 | |
| 915 | + device = redisCatchStorage.getDevice(channelId); | |
| 916 | + if (device == null) { | |
| 917 | + device = storager.queryVideoDeviceByChannelId(channelId); | |
| 918 | + realChannelId = channelId; | |
| 919 | + } | |
| 920 | + } | |
| 921 | + | |
| 922 | + if (device == null) { | |
| 923 | + logger.warn("来自设备的Invite请求,无法从请求信息中确定所属设备,已忽略,requesterId: {}/{}", requesterId, channelId); | |
| 924 | + try { | |
| 925 | + responseAck(request, Response.FORBIDDEN); | |
| 926 | + } catch (SipException | InvalidArgumentException | ParseException e) { | |
| 927 | + logger.error("[命令发送失败] 来自设备的Invite请求,无法从请求信息中确定所属设备 FORBIDDEN: {}", e.getMessage()); | |
| 928 | + } | |
| 929 | + return; | |
| 930 | + } | |
| 931 | + | |
| 932 | + AudioBroadcastCatch broadcastCatch = audioBroadcastManager.get(device.getDeviceId(), realChannelId); | |
| 907 | 933 | if (broadcastCatch == null) { |
| 908 | 934 | logger.warn("来自设备的Invite请求非语音广播,已忽略,requesterId: {}/{}", requesterId, channelId); |
| 909 | 935 | try { | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
| ... | ... | @@ -453,7 +453,7 @@ public class PlayServiceImpl implements IPlayService { |
| 453 | 453 | // 检查是否有y字段 |
| 454 | 454 | if (ssrcIndex >= 0) { |
| 455 | 455 | //ssrc规定长度为10字节,不取余下长度以避免后续还有“f=”字段 TODO 后续对不规范的非10位ssrc兼容 |
| 456 | - String ssrcInResponse = contentString.substring(ssrcIndex + 2, ssrcIndex + 12); | |
| 456 | + String ssrcInResponse = contentString.substring(ssrcIndex + 2, ssrcIndex + 12).trim(); | |
| 457 | 457 | // 查询到ssrc不一致且开启了ssrc校验则需要针对处理 |
| 458 | 458 | if (ssrcInfo.getSsrc().equals(ssrcInResponse)) { |
| 459 | 459 | return; | ... | ... |