From 1710a63fc8ddf37041673bcf314a28ab4606705b Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Wed, 23 Oct 2024 16:38:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BD=E6=A0=87=E7=BA=A7?= =?UTF-8?q?=E8=81=94=E8=AF=AD=E9=9F=B3=E5=AF=B9=E8=AE=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transmit/cmd/SIPRequestHeaderPlarformProvider.java | 2 +- .../event/request/impl/ByeRequestProcessor.java | 10 +++++----- .../notify/cmd/BroadcastNotifyMessageHandler.java | 1 - .../response/cmd/BroadcastResponseMessageHandler.java | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderPlarformProvider.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderPlarformProvider.java index 628bdcd8..b09d47cc 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderPlarformProvider.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderPlarformProvider.java @@ -345,7 +345,7 @@ public class SIPRequestHeaderPlarformProvider { Address concatAddress = SipFactory.getInstance().createAddressFactory().createAddress(SipFactory.getInstance().createAddressFactory().createSipURI(sipConfig.getId(),localHostAddress)); request.addHeader(SipFactory.getInstance().createHeaderFactory().createContactHeader(concatAddress)); // Subject - SubjectHeader subjectHeader = SipFactory.getInstance().createHeaderFactory().createSubjectHeader(String.format("%s:%s,%s:%s", channelId, ssrc, sipConfig.getId(), 0)); + SubjectHeader subjectHeader = SipFactory.getInstance().createHeaderFactory().createSubjectHeader(String.format("%s:%s,%s:%s", sipConfig.getId(), ssrc, channelId, 0)); request.addHeader(subjectHeader); ContentTypeHeader contentTypeHeader = SipFactory.getInstance().createHeaderFactory().createContentTypeHeader("APPLICATION", "SDP"); request.setContent(content, contentTypeHeader); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java index 6d905f18..c6dd5f98 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java @@ -187,19 +187,19 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In if (ssrcTransaction.getPlatformId() != null ) { - Platform platform = platformService.queryPlatformByServerGBId(ssrcTransaction.getDeviceId()); + Platform platform = platformService.queryPlatformByServerGBId(ssrcTransaction.getPlatformId()); if (ssrcTransaction.getType().equals(InviteSessionType.BROADCAST)) { - log.info("[收到bye] 上级停止语音对讲,来自:{}, 通道已停止推流: {}", ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId()); + log.info("[收到bye] 上级停止语音对讲,来自:{}, 通道已停止推流: {}", ssrcTransaction.getPlatformId(), ssrcTransaction.getChannelId()); CommonGBChannel channel = channelService.getOne(ssrcTransaction.getChannelId()); if (channel == null) { - log.info("[收到bye] 未找到通道,设备:{}, 通道:{}", ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId()); + log.info("[收到bye] 未找到通道,上级:{}, 通道:{}", ssrcTransaction.getPlatformId(), ssrcTransaction.getChannelId()); return; } String mediaServerId = ssrcTransaction.getMediaServerId(); platformService.stopBroadcast(platform, channel, ssrcTransaction.getStream(), false, mediaServerService.getOne(mediaServerId)); - Device device = deviceService.getDeviceByDeviceId(ssrcTransaction.getDeviceId()); - DeviceChannel deviceChannel = deviceChannelService.getOneForSourceById(ssrcTransaction.getChannelId()); + DeviceChannel deviceChannel = deviceChannelService.getOneForSourceById(channel.getGbId()); + Device device = deviceService.getDevice(channel.getGbDeviceDbId()); playService.stopAudioBroadcast(device, deviceChannel); } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/BroadcastNotifyMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/BroadcastNotifyMessageHandler.java index f278ef30..cccce02d 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/BroadcastNotifyMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/BroadcastNotifyMessageHandler.java @@ -123,7 +123,6 @@ public class BroadcastNotifyMessageHandler extends SIPRequestProcessorParent imp commanderForPlatform.broadcastResultCmd(platform, channel, sn, true, eventResult->{ log.info("[国标级联] 语音喊话 回复失败 platform: {}, 错误:{}/{}", platform.getServerGBId(), eventResult.statusCode, eventResult.msg); }, eventResult->{ - // 消息发送成功, 向上级发送invite,获取推流 try { platformService.broadcastInvite(platform, channel, mediaServerForMinimumLoad, (hookData)->{ diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/BroadcastResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/BroadcastResponseMessageHandler.java index a0ae0554..97748222 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/BroadcastResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/BroadcastResponseMessageHandler.java @@ -65,7 +65,7 @@ public class BroadcastResponseMessageHandler extends SIPRequestProcessorParent i } if (!audioBroadcastManager.exit(channel.getId())) { // 回复410 - responseAck((SIPRequest) evt.getRequest(), Response.GONE); + responseAck((SIPRequest) evt.getRequest(), Response.BUSY_HERE); return; } String result = getText(rootElement, "Result");