From 335916f1f15eb9d0b34dea38cacee2300eac0606 Mon Sep 17 00:00:00 2001 From: 李防 <liguofang0703@126.com> Date: 星期一, 07 三月 2022 14:20:27 +0800 Subject: [PATCH] InviteRequestProcessor类中,channelid从invite消息的header subject获取,不再从第一行request line获取。原因是和第三方平台对接时,发送的invite消息第一行为国标平台编码而不是设备通道编码,导致报错通道不存在,返回404。 --- src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java | 34 ++++++++++++++++++++++++---------- 1 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java index 51c8c8e..1226eb7 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java @@ -1,7 +1,11 @@ package com.genersoft.iot.vmp.vmanager.streamProxy; import com.alibaba.fastjson.JSONObject; +import com.genersoft.iot.vmp.common.StreamInfo; +import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; +import com.genersoft.iot.vmp.service.IMediaServerService; +import com.genersoft.iot.vmp.service.IMediaService; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.service.IStreamProxyService; import com.genersoft.iot.vmp.vmanager.bean.WVPResult; @@ -14,6 +18,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; @SuppressWarnings("rawtypes") @@ -30,6 +35,10 @@ @Autowired private IRedisCatchStorage redisCatchStorage; + + + @Autowired + private IMediaServerService mediaServerService; @Autowired private IStreamProxyService streamProxyService; @@ -60,19 +69,24 @@ @ResponseBody public WVPResult save(@RequestBody StreamProxyItem param){ logger.info("娣诲姞浠g悊锛� " + JSONObject.toJSONString(param)); - String msg = streamProxyService.save(param); - WVPResult<Object> result = new WVPResult<>(); - result.setCode(0); - result.setMsg(msg); + if (StringUtils.isEmpty(param.getMediaServerId())) param.setMediaServerId("auto"); + if (StringUtils.isEmpty(param.getType())) param.setType("default"); + if (StringUtils.isEmpty(param.getGbId())) param.setGbId(null); + WVPResult<StreamInfo> result = streamProxyService.save(param); return result; } @ApiOperation("鑾峰彇ffmpeg.cmd妯℃澘") @GetMapping(value = "/ffmpeg_cmd/list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "mediaServerId", value = "娴佸獟浣揑D", dataTypeClass = String.class), + }) @ResponseBody - public WVPResult getFFmpegCMDs(){ - logger.debug("鑾峰彇ffmpeg.cmd妯℃澘锛�" ); - JSONObject data = streamProxyService.getFFmpegCMDs(); + public WVPResult getFFmpegCMDs(@RequestParam String mediaServerId){ + logger.debug("鑾峰彇鑺傜偣[ {} ]ffmpeg.cmd妯℃澘", mediaServerId ); + + MediaServerItem mediaServerItem = mediaServerService.getOne(mediaServerId); + JSONObject data = streamProxyService.getFFmpegCMDs(mediaServerItem); WVPResult<JSONObject> result = new WVPResult<>(); result.setCode(0); result.setMsg("success"); @@ -82,12 +96,12 @@ @ApiOperation("绉婚櫎浠g悊") @ApiImplicitParams({ - @ApiImplicitParam(name = "app", value = "搴旂敤鍚�", dataTypeClass = String.class), - @ApiImplicitParam(name = "stream", value = "娴両D", dataTypeClass = String.class), + @ApiImplicitParam(name = "app", value = "搴旂敤鍚�", required = true, dataTypeClass = String.class), + @ApiImplicitParam(name = "stream", value = "娴両D", required = true, dataTypeClass = String.class), }) @DeleteMapping(value = "/del") @ResponseBody - public WVPResult del(String app, String stream){ + public WVPResult del(@RequestParam String app, @RequestParam String stream){ logger.info("绉婚櫎浠g悊锛� " + app + "/" + stream); WVPResult<Object> result = new WVPResult<>(); if (app == null || stream == null) { -- Gitblit v1.8.0