| | |
| | | package com.genersoft.iot.vmp.vmanager.cloudRecord; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.genersoft.iot.vmp.conf.DynamicTask; |
| | | import com.genersoft.iot.vmp.conf.UserSetting; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.service.ICloudRecordService; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | @RequestParam(required = false) String callId, |
| | | @RequestParam(required = false) String remoteHost |
| | | ){ |
| | | System.out.println(request.getScheme()); |
| | | System.out.println(request.getLocalAddr()); |
| | | System.out.println(request.getRemoteAddr()); |
| | | System.out.println(request.getRequestURI()); |
| | | MediaServerItem mediaServerItem; |
| | | if (mediaServerId == null) { |
| | | mediaServerItem = mediaServerService.getDefaultMediaServer(); |
| | |
| | | throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到可用的流媒体"); |
| | | }else { |
| | | if (remoteHost == null) { |
| | | remoteHost = request.getScheme() + "://" + request.getLocalAddr() + ":" + mediaServerItem.getRecordAssistPort(); |
| | | remoteHost = request.getScheme() + "://" + mediaServerItem.getIp() + ":" + mediaServerItem.getRecordAssistPort(); |
| | | } |
| | | } |
| | | return cloudRecordService.addTask(app, stream, mediaServerItem, startTime, endTime, callId, remoteHost); |
| | | return cloudRecordService.addTask(app, stream, mediaServerItem, startTime, endTime, callId, remoteHost, mediaServerId != null); |
| | | } |
| | | |
| | | @ResponseBody |
| | |
| | | @Parameter(name = "mediaServerId", description = "流媒体ID", required = false) |
| | | @Parameter(name = "isEnd", description = "是否结束", required = false) |
| | | public JSONArray queryTaskList( |
| | | HttpServletRequest request, |
| | | @RequestParam(required = false) String app, |
| | | @RequestParam(required = false) String stream, |
| | | @RequestParam(required = false) String callId, |
| | |
| | | @RequestParam(required = false) String mediaServerId, |
| | | @RequestParam(required = false) Boolean isEnd |
| | | ){ |
| | | return cloudRecordService.queryTask(app, stream, callId, taskId, mediaServerId, isEnd); |
| | | if (ObjectUtils.isEmpty(mediaServerId)) { |
| | | mediaServerId = null; |
| | | } |
| | | |
| | | return cloudRecordService.queryTask(app, stream, callId, taskId, mediaServerId, isEnd, request.getScheme()); |
| | | } |
| | | |
| | | @ResponseBody |