支持推流鉴权

dev/abl支持
648540858 2024-04-11 23:36:06 +08:00
parent 9800fd6e7b
commit 8716160d96
2 changed files with 8 additions and 4 deletions

View File

@ -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,11 +178,15 @@ public class ABLHttpHookListener {
return new HookResultForOnPublish(0, "success");
}
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();
}

View File

@ -129,7 +129,6 @@ public class ABLMediaNodeServerService implements IMediaNodeServerService {
@Override
public List<StreamInfo> 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;