diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/control/RedisRpcController.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/control/RedisRpcController.java index c624b1a7..cdd4f4a9 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/control/RedisRpcController.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/control/RedisRpcController.java @@ -174,19 +174,20 @@ public class RedisRpcController { if (streamInfoInServer != null) { log.info("[redis-rpc] 监听流上线时发现流已存在直接返回: {}/{}", streamInfo.getApp(), streamInfo.getStream()); RedisRpcResponse response = request.getResponse(); - response.setBody(streamInfoInServer); + response.setBody(JSONObject.toJSONString(streamInfoInServer)); response.setStatusCode(200); return response; } // 监听流上线。 流上线直接发送sendRtpItem消息给实际的信令处理者 - Hook hook = Hook.getInstance(HookType.on_media_arrival, streamInfo.getApp(), streamInfo.getStream(), null); + Hook hook = Hook.getInstance(HookType.on_media_arrival, streamInfo.getApp(), streamInfo.getStream()); hookSubscribe.addSubscribe(hook, (hookData) -> { log.info("[redis-rpc] 监听流上线,流已上线: {}/{}", streamInfo.getApp(), streamInfo.getStream()); // 读取redis中的上级点播信息,生成sendRtpItm发送出去 RedisRpcResponse response = request.getResponse(); - response.setBody(mediaServerService.getStreamInfoByAppAndStream(hookData.getMediaServer(), + StreamInfo streamInfoByAppAndStream = mediaServerService.getStreamInfoByAppAndStream(hookData.getMediaServer(), streamInfo.getApp(), streamInfo.getStream(), hookData.getMediaInfo(), - hookData.getMediaInfo() != null ? hookData.getMediaInfo().getCallId() : null)); + hookData.getMediaInfo() != null ? hookData.getMediaInfo().getCallId() : null); + response.setBody(JSONObject.toJSONString(streamInfoByAppAndStream)); response.setStatusCode(200); // 手动发送结果 sendResponse(response); diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/service/RedisRpcServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/service/RedisRpcServiceImpl.java index 0a748e3d..76ccfeab 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/service/RedisRpcServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/service/RedisRpcServiceImpl.java @@ -164,6 +164,7 @@ public class RedisRpcServiceImpl implements IRedisRpcService { streamInfoParam.setStream(stream); RedisRpcRequest request = buildRequest("onStreamOnlineEvent", streamInfoParam); hookSubscribe.addSubscribe(hook, (hookData) -> { + log.info("[请求所有WVP监听流上线] 监听流上线 {}/{}", app, stream); if (callback != null) { callback.run(mediaServerService.getStreamInfoByAppAndStream(hookData.getMediaServer(), app, stream, hookData.getMediaInfo(), @@ -181,7 +182,7 @@ public class RedisRpcServiceImpl implements IRedisRpcService { log.info("[请求所有WVP监听流上线] 流上线 {}/{}", app, stream); if (callback != null) { - callback.run((StreamInfo) response.getBody()); + callback.run(JSON.parseObject(response.getBody().toString(), StreamInfo.class)); } hookSubscribe.removeSubscribe(hook); });