From 8716160d96e18b9374876e812ecefd3d086a81a0 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Thu, 11 Apr 2024 23:36:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=8E=A8=E6=B5=81=E9=89=B4?= =?UTF-8?q?=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/media/abl/ABLHttpHookListener.java | 11 ++++++++--- .../iot/vmp/media/abl/ABLMediaNodeServerService.java | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/abl/ABLHttpHookListener.java b/src/main/java/com/genersoft/iot/vmp/media/abl/ABLHttpHookListener.java index 252b37bd..706203e4 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/abl/ABLHttpHookListener.java +++ b/src/main/java/com/genersoft/iot/vmp/media/abl/ABLHttpHookListener.java @@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.media.abl; import com.alibaba.fastjson2.JSONObject; import com.genersoft.iot.vmp.conf.UserSetting; +import com.genersoft.iot.vmp.conf.exception.ControllerException; import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager; import com.genersoft.iot.vmp.gb28181.session.SSRCFactory; @@ -177,9 +178,13 @@ public class ABLHttpHookListener { return new HookResultForOnPublish(0, "success"); } - ResultForOnPublish resultForOnPublish = mediaService.authenticatePublish(mediaServer, param.getApp(), param.getStream(), param.getParams()); - if (resultForOnPublish == null) { - logger.info("[ABL HOOK]推流鉴权 拒绝 响应:{}->{}", param.getMediaServerId(), param); + try { + ResultForOnPublish resultForOnPublish = mediaService.authenticatePublish(mediaServer, param.getApp(), param.getStream(), param.getParams()); + if (resultForOnPublish == null) { + logger.info("[ABL HOOK]推流鉴权 拒绝 响应:{}->{}", param.getMediaServerId(), param); + ablresTfulUtils.closeStreams(mediaServer, param.getApp(), param.getStream()); + } + }catch (ControllerException e) { ablresTfulUtils.closeStreams(mediaServer, param.getApp(), param.getStream()); } return HookResult.SUCCESS(); diff --git a/src/main/java/com/genersoft/iot/vmp/media/abl/ABLMediaNodeServerService.java b/src/main/java/com/genersoft/iot/vmp/media/abl/ABLMediaNodeServerService.java index 3ba5e639..293def33 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/abl/ABLMediaNodeServerService.java +++ b/src/main/java/com/genersoft/iot/vmp/media/abl/ABLMediaNodeServerService.java @@ -129,7 +129,6 @@ public class ABLMediaNodeServerService implements IMediaNodeServerService { @Override public List getMediaList(MediaServer mediaServer, String app, String stream, String callId) { - logger.warn("[abl-getMediaList] 未实现"); JSONObject jsonObject = ablresTfulUtils.getMediaList(mediaServer, app, stream); if (jsonObject == null || jsonObject.getInteger("code") != 0) { return null;