32个文件已修改
9个文件已添加
4 文件已重命名
2个文件已删除
| | |
| | | |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.genersoft.iot.vmp.media.zlm.AssistRESTfulUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.bean.CloudRecordItem; |
| | | import com.genersoft.iot.vmp.storager.dao.CloudRecordServiceMapper; |
| | | import com.genersoft.iot.vmp.vmanager.cloudRecord.CloudRecordController; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | package com.genersoft.iot.vmp.conf; |
| | | |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import org.apache.http.HttpHost; |
| | | import org.apache.http.HttpRequest; |
| | | import org.apache.http.HttpResponse; |
| | |
| | | package com.genersoft.iot.vmp.conf; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | |
| | | @Autowired |
| | | private IRedisCatchStorage redisCatchStorage; |
| | | |
| | | @Autowired |
| | | private IMediaServerService mediaServerService; |
| | | |
| | | @Value("${server.port}") |
| | | private int serverPort; |
| | |
| | | import com.genersoft.iot.vmp.gb28181.event.device.RequestTimeoutEvent; |
| | | import com.genersoft.iot.vmp.gb28181.event.record.RecordEndEvent; |
| | | import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent; |
| | | import com.genersoft.iot.vmp.media.zlm.event.ZLMOfflineEvent; |
| | | import com.genersoft.iot.vmp.media.zlm.event.ZLMOnlineEvent; |
| | | import com.genersoft.iot.vmp.media.zlm.event.MediaServerOfflineEvent; |
| | | import com.genersoft.iot.vmp.media.zlm.event.MediaServerOnlineEvent; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationEventPublisher; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | } |
| | | |
| | | public void zlmOfflineEventPublish(String mediaServerId){ |
| | | ZLMOfflineEvent outEvent = new ZLMOfflineEvent(this); |
| | | MediaServerOfflineEvent outEvent = new MediaServerOfflineEvent(this); |
| | | outEvent.setMediaServerId(mediaServerId); |
| | | applicationEventPublisher.publishEvent(outEvent); |
| | | } |
| | | |
| | | public void zlmOnlineEventPublish(String mediaServerId) { |
| | | ZLMOnlineEvent outEvent = new ZLMOnlineEvent(this); |
| | | public void mediaServerOnlineEventPublish(String mediaServerId) { |
| | | MediaServerOnlineEvent outEvent = new MediaServerOnlineEvent(this); |
| | | outEvent.setMediaServerId(mediaServerId); |
| | | applicationEventPublisher.publishEvent(outEvent); |
| | | } |
| | |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.service.IDeviceService; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.IPlatformService; |
| | | import com.genersoft.iot.vmp.service.impl.PlatformServiceImpl; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | |
| | | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamPush;
|
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
| | | import com.genersoft.iot.vmp.media.zlm.dto.hook.HookParam;
|
| | | import com.genersoft.iot.vmp.service.IMediaServerService;
|
| | | import com.genersoft.iot.vmp.media.IMediaServerService;
|
| | | import com.genersoft.iot.vmp.service.bean.SSRCInfo;
|
| | | import com.genersoft.iot.vmp.utils.DateUtil;
|
| | | import gov.nist.javax.sip.message.SIPRequest;
|
| | |
| | | import javax.sip.header.CallIdHeader;
|
| | | import javax.sip.message.Request;
|
| | | import java.text.ParseException;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.hook.HookParam; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.bean.GPSMsgInfo; |
| | | import com.genersoft.iot.vmp.service.bean.SSRCInfo; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | |
| | | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.service.IDeviceService; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.IPlayService; |
| | | import com.genersoft.iot.vmp.service.bean.RequestPushStreamMsg; |
| | | import com.genersoft.iot.vmp.service.redisMsg.RedisGbPlayMsgListener; |
| | |
| | | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.service.*; |
| | |
| | | import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; |
| | | import com.genersoft.iot.vmp.gb28181.utils.SipUtils; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMMediaListManager; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| | | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| | |
| | | package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.notify.cmd; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; |
| | | import com.genersoft.iot.vmp.gb28181.bean.*; |
| | | import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| | |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam; |
| | | import com.genersoft.iot.vmp.service.IDeviceService; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.IPlatformService; |
| | | import com.genersoft.iot.vmp.service.IPlayService; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
New file |
| | |
| | | package com.genersoft.iot.vmp.media; |
| | | |
| | | import com.genersoft.iot.vmp.common.CommonCallback; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | |
| | | public interface IMediaNodeServerService { |
| | | int createRTPServer(MediaServerItem mediaServerItem, String streamId, long ssrc, Integer port, Boolean onlyAuto, Boolean reUsePort, Integer tcpMode); |
| | | |
| | | void closeRtpServer(MediaServerItem mediaServerItem, String streamId); |
| | | |
| | | void closeRtpServer(MediaServerItem mediaServerItem, String streamId, CommonCallback<Boolean> callback); |
| | | |
| | | void closeStreams(MediaServerItem mediaServerItem, String rtp, String streamId); |
| | | |
| | | Boolean updateRtpServerSSRC(MediaServerItem mediaServerItem, String streamId, String ssrc); |
| | | |
| | | boolean checkNodeId(MediaServerItem mediaServerItem); |
| | | |
| | | void online(MediaServerItem mediaServerItem); |
| | | } |
File was renamed from src/main/java/com/genersoft/iot/vmp/service/IMediaServerService.java |
| | |
| | | package com.genersoft.iot.vmp.service; |
| | | package com.genersoft.iot.vmp.media; |
| | | |
| | | import com.genersoft.iot.vmp.common.CommonCallback; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMServerConfig; |
New file |
| | |
| | | package com.genersoft.iot.vmp.media.abl; |
| | | |
| | | import com.genersoft.iot.vmp.media.IMediaNodeServerService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("abl") |
| | | public class ABLMediaNodeServerService implements IMediaNodeServerService { |
| | | } |
File was renamed from src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java |
| | |
| | | package com.genersoft.iot.vmp.service.impl; |
| | | package com.genersoft.iot.vmp.media.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.gb28181.event.EventPublisher; |
| | | import com.genersoft.iot.vmp.gb28181.session.SSRCFactory; |
| | | import com.genersoft.iot.vmp.media.IMediaNodeServerService; |
| | | import com.genersoft.iot.vmp.media.zlm.*; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.ServerKeepaliveData; |
| | | import com.genersoft.iot.vmp.service.IInviteStreamService; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.bean.MediaServerLoad; |
| | | import com.genersoft.iot.vmp.service.bean.SSRCInfo; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | |
| | | import com.genersoft.iot.vmp.utils.JsonUtil; |
| | | import com.genersoft.iot.vmp.utils.redis.RedisUtil; |
| | | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| | | import com.genersoft.iot.vmp.vmanager.bean.RecordFile; |
| | | import okhttp3.OkHttpClient; |
| | | import okhttp3.Request; |
| | | import okhttp3.Response; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.TransactionDefinition; |
| | | import org.springframework.transaction.TransactionStatus; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import java.io.File; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.concurrent.CompletableFuture; |
| | | import java.util.concurrent.ExecutionException; |
| | | |
| | | /** |
| | | * åªä½æå¡å¨èç¹ç®¡ç |
| | |
| | | private AssistRESTfulUtils assistRESTfulUtils; |
| | | |
| | | @Autowired |
| | | private ZLMRESTfulUtils zlmresTfulUtils; |
| | | |
| | | @Autowired |
| | | private MediaServerMapper mediaServerMapper; |
| | | |
| | | @Autowired |
| | |
| | | @Autowired |
| | | private RedisTemplate<Object, Object> redisTemplate; |
| | | |
| | | @Qualifier("taskExecutor") |
| | | @Autowired |
| | | private ThreadPoolTaskExecutor taskExecutor; |
| | | |
| | | |
| | | |
| | | private Map<String, IMediaNodeServerService> nodeServerServiceMap; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public void updateVmServer(List<MediaServerItem> mediaServerItemList) { |
| | | logger.info("[zlm] ç¼ååå§å "); |
| | | logger.info("[åªä½æå¡èç¹] ç¼ååå§å "); |
| | | for (MediaServerItem mediaServerItem : mediaServerItemList) { |
| | | if (ObjectUtils.isEmpty(mediaServerItem.getId())) { |
| | | continue; |
| | |
| | | } |
| | | int rtpServerPort; |
| | | if (mediaServerItem.isRtpEnable()) { |
| | | rtpServerPort = zlmServerFactory.createRTPServer(mediaServerItem, streamId, ssrcCheck ? Long.parseLong(ssrc) : 0, port, onlyAuto, reUsePort, tcpMode); |
| | | IMediaNodeServerService mediaNodeServerService = nodeServerServiceMap.get(mediaServerItem.getType()); |
| | | if (mediaNodeServerService == null) { |
| | | logger.info("[openRTPServer] 失败, mediaServerItemçç±»åï¼ {}ï¼æªæ¾å°å¯¹åºçå®ç°ç±»", mediaServerItem.getType()); |
| | | return null; |
| | | } |
| | | rtpServerPort = mediaNodeServerService.createRTPServer(mediaServerItem, streamId, ssrcCheck ? Long.parseLong(ssrc) : 0, port, onlyAuto, reUsePort, tcpMode); |
| | | } else { |
| | | rtpServerPort = mediaServerItem.getRtpProxyPort(); |
| | | } |
| | |
| | | if (mediaServerItem == null) { |
| | | return; |
| | | } |
| | | zlmServerFactory.closeRtpServer(mediaServerItem, streamId); |
| | | IMediaNodeServerService mediaNodeServerService = nodeServerServiceMap.get(mediaServerItem.getType()); |
| | | if (mediaNodeServerService == null) { |
| | | logger.info("[closeRTPServer] 失败, mediaServerItemçç±»åï¼ {}ï¼æªæ¾å°å¯¹åºçå®ç°ç±»", mediaServerItem.getType()); |
| | | return; |
| | | } |
| | | mediaNodeServerService.closeRtpServer(mediaServerItem, streamId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | callback.run(false); |
| | | return; |
| | | } |
| | | zlmServerFactory.closeRtpServer(mediaServerItem, streamId, callback); |
| | | IMediaNodeServerService mediaNodeServerService = nodeServerServiceMap.get(mediaServerItem.getType()); |
| | | if (mediaNodeServerService == null) { |
| | | logger.info("[closeRTPServer] 失败, mediaServerItemçç±»åï¼ {}ï¼æªæ¾å°å¯¹åºçå®ç°ç±»", mediaServerItem.getType()); |
| | | return; |
| | | } |
| | | mediaNodeServerService.closeRtpServer(mediaServerItem, streamId, callback); |
| | | } |
| | | |
| | | @Override |
| | | public void closeRTPServer(String mediaServerId, String streamId) { |
| | | MediaServerItem mediaServerItem = this.getOne(mediaServerId); |
| | | if (mediaServerItem != null && mediaServerItem.isRtpEnable()) { |
| | | if (mediaServerItem == null) { |
| | | return; |
| | | } |
| | | if (mediaServerItem.isRtpEnable()) { |
| | | closeRTPServer(mediaServerItem, streamId); |
| | | } |
| | | zlmresTfulUtils.closeStreams(mediaServerItem, "rtp", streamId); |
| | | IMediaNodeServerService mediaNodeServerService = nodeServerServiceMap.get(mediaServerItem.getType()); |
| | | if (mediaNodeServerService == null) { |
| | | logger.info("[closeRTPServer] 失败, mediaServerItemçç±»åï¼ {}ï¼æªæ¾å°å¯¹åºçå®ç°ç±»", mediaServerItem.getType()); |
| | | return; |
| | | } |
| | | mediaNodeServerService.closeStreams(mediaServerItem, "rtp", streamId); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateRtpServerSSRC(MediaServerItem mediaServerItem, String streamId, String ssrc) { |
| | | return zlmServerFactory.updateRtpServerSSRC(mediaServerItem, streamId, ssrc); |
| | | if (mediaServerItem == null) { |
| | | return false; |
| | | } |
| | | IMediaNodeServerService mediaNodeServerService = nodeServerServiceMap.get(mediaServerItem.getType()); |
| | | if (mediaNodeServerService == null) { |
| | | logger.info("[updateRtpServerSSRC] 失败, mediaServerItemçç±»åï¼ {}ï¼æªæ¾å°å¯¹åºçå®ç°ç±»", mediaServerItem.getType()); |
| | | return false; |
| | | } |
| | | return mediaNodeServerService.updateRtpServerSSRC(mediaServerItem, streamId, ssrc); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | /** |
| | | * zlm éå¯åéç½®ä»çæ¨æµä¿¡æ¯ï¼ TODO ç»æ£å¨ä½¿ç¨ç设å¤åé忢å½ä»¤ |
| | | * åªä½æå¡èç¹ éå¯åéç½®ä»çæ¨æµä¿¡æ¯ï¼ TODO ç»æ£å¨ä½¿ç¨ç设å¤åé忢å½ä»¤ |
| | | */ |
| | | @Override |
| | | public void clearRTPServer(MediaServerItem mediaServerItem) { |
| | | ssrcFactory.reset(mediaServerItem.getId()); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·åå个zlmæå¡å¨ |
| | | * è·åå个åªä½æå¡èç¹æå¡å¨ |
| | | * @param mediaServerId æå¡id |
| | | * @return MediaServerItem |
| | | */ |
| | |
| | | mediaServerItem.setCreateTime(DateUtil.getNow()); |
| | | mediaServerItem.setUpdateTime(DateUtil.getNow()); |
| | | mediaServerItem.setHookAliveInterval(30f); |
| | | JSONObject responseJSON = zlmresTfulUtils.getMediaServerConfig(mediaServerItem); |
| | | if (responseJSON != null) { |
| | | JSONArray data = responseJSON.getJSONArray("data"); |
| | | if (data != null && data.size() > 0) { |
| | | ZLMServerConfig zlmServerConfig= JSON.parseObject(JSON.toJSONString(data.get(0)), ZLMServerConfig.class); |
| | | if (mediaServerMapper.queryOne(zlmServerConfig.getGeneralMediaServerId()) != null) { |
| | | throw new ControllerException(ErrorCode.ERROR100.getCode(),"ä¿å失败ï¼åªä½æå¡ID [ " + zlmServerConfig.getGeneralMediaServerId() + " ] å·²åå¨ï¼è¯·ä¿®æ¹åªä½æå¡å¨é
ç½®"); |
| | | if (mediaServerItem.getType() == null) { |
| | | logger.info("[æ·»å åªä½èç¹] 失败, mediaServerItemçç±»åï¼ä¸ºç©º"); |
| | | return; |
| | | } |
| | | mediaServerItem.setId(zlmServerConfig.getGeneralMediaServerId()); |
| | | zlmServerConfig.setIp(mediaServerItem.getIp()); |
| | | IMediaNodeServerService mediaNodeServerService = nodeServerServiceMap.get(mediaServerItem.getType()); |
| | | if (mediaNodeServerService == null) { |
| | | logger.info("[æ·»å åªä½èç¹] 失败, mediaServerItemçç±»åï¼ {}ï¼æªæ¾å°å¯¹åºçå®ç°ç±»", mediaServerItem.getType()); |
| | | return; |
| | | } |
| | | if (mediaNodeServerService.checkNodeId(mediaServerItem)) { |
| | | mediaServerMapper.add(mediaServerItem); |
| | | zlmServerOnline(zlmServerConfig); |
| | | mediaNodeServerService.online(mediaServerItem); |
| | | }else { |
| | | throw new ControllerException(ErrorCode.ERROR100.getCode(),"è¿æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | }else { |
| | | throw new ControllerException(ErrorCode.ERROR100.getCode(),"è¿æ¥å¤±è´¥"); |
| | | throw new ControllerException(ErrorCode.ERROR100.getCode(),"ä¿å失败ï¼åªä½æå¡ID [ " + mediaServerItem.getId() + " ] å·²åå¨ï¼è¯·ä¿®æ¹åªä½æå¡å¨é
ç½®"); |
| | | } |
| | | } |
| | | |
| | |
| | | TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); |
| | | int delResult = mediaServerMapper.delDefault(); |
| | | if (delResult == 0) { |
| | | logger.error("ç§»é¤æ°æ®åºé»è®¤zlmèç¹å¤±è´¥"); |
| | | logger.error("ç§»é¤æ°æ®åºé»è®¤åªä½æå¡èç¹èç¹å¤±è´¥"); |
| | | //äºå¡åæ» |
| | | dataSourceTransactionManager.rollback(transactionStatus); |
| | | return 0; |
| | |
| | | } |
| | | |
| | | /** |
| | | * å¤çzlmä¸çº¿ |
| | | * @param zlmServerConfig zlmä¸çº¿æºå¸¦çåæ° |
| | | * å¤çåªä½æå¡èç¹ä¸çº¿ |
| | | * @param zlmServerConfig åªä½æå¡èç¹ä¸çº¿æºå¸¦çåæ° |
| | | */ |
| | | @Override |
| | | public void zlmServerOnline(ZLMServerConfig zlmServerConfig) { |
| | | |
| | | MediaServerItem serverItem = mediaServerMapper.queryOne(zlmServerConfig.getGeneralMediaServerId()); |
| | | if (serverItem == null) { |
| | | logger.warn("[æªæ³¨åçzlm] ææ¥æ¥å
¥ï¼{}æ¥èª{}ï¼{}", zlmServerConfig.getGeneralMediaServerId(), zlmServerConfig.getIp(),zlmServerConfig.getHttpPort() ); |
| | | logger.warn("è¯·æ£æ¥ZLMç<general.mediaServerId>é
ç½®æ¯å¦ä¸WVPç<media.id>ä¸è´"); |
| | | logger.warn("[æªæ³¨åçåªä½æå¡èç¹] ææ¥æ¥å
¥ï¼{}æ¥èª{}ï¼{}", zlmServerConfig.getGeneralMediaServerId(), zlmServerConfig.getIp(),zlmServerConfig.getHttpPort() ); |
| | | logger.warn("è¯·æ£æ¥åªä½æå¡èç¹çIDé
ç½®æ¯å¦ä¸WVPç<media.id>ä¸è´"); |
| | | return; |
| | | }else { |
| | | logger.info("[ZLM] æ£å¨è¿æ¥ : {} -> {}:{}", |
| | | logger.info("[åªä½æå¡èç¹] æ£å¨è¿æ¥ : {} -> {}:{}", |
| | | zlmServerConfig.getGeneralMediaServerId(), zlmServerConfig.getIp(), zlmServerConfig.getHttpPort()); |
| | | } |
| | | serverItem.setHookAliveInterval(zlmServerConfig.getHookAliveInterval()); |
| | |
| | | serverItem.setStatus(true); |
| | | |
| | | if (ObjectUtils.isEmpty(serverItem.getId())) { |
| | | logger.warn("[æªæ³¨åçzlm] serverItem缺å°IDï¼ æ æ³æ¥å
¥ï¼{}ï¼{}", zlmServerConfig.getIp(),zlmServerConfig.getHttpPort() ); |
| | | logger.warn("[æªæ³¨åçåªä½æå¡èç¹] serverItem缺å°IDï¼ æ æ³æ¥å
¥ï¼{}ï¼{}", zlmServerConfig.getIp(),zlmServerConfig.getHttpPort() ); |
| | | return; |
| | | } |
| | | mediaServerMapper.update(serverItem); |
| | |
| | | final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + serverItem.getId(); |
| | | dynamicTask.stop(zlmKeepaliveKey); |
| | | dynamicTask.startDelay(zlmKeepaliveKey, new KeepAliveTimeoutRunnable(serverItem), (serverItem.getHookAliveInterval().intValue() + 5) * 1000); |
| | | publisher.zlmOnlineEventPublish(serverItem.getId()); |
| | | publisher.mediaServerOnlineEventPublish(serverItem.getId()); |
| | | |
| | | logger.info("[ZLM] è¿æ¥æå {} - {}:{} ", |
| | | logger.info("[åªä½æå¡èç¹] è¿æ¥æå {} - {}:{} ", |
| | | zlmServerConfig.getGeneralMediaServerId(), zlmServerConfig.getIp(), zlmServerConfig.getHttpPort()); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public void run() { |
| | | logger.info("[zlmå¿è·³å°æ]ï¼" + serverItem.getId()); |
| | | logger.info("[åªä½æå¡èç¹å¿è·³å°æ]ï¼" + serverItem.getId()); |
| | | // åèµ·http请æ±éªè¯zlmæ¯å¦ç¡®å®æ æ³è¿æ¥ï¼å¦æç¡®å®æ æ³è¿æ¥ååé离线äºä»¶ï¼å¦åä¸ä½å¤ç |
| | | JSONObject mediaServerConfig = zlmresTfulUtils.getMediaServerConfig(serverItem); |
| | | if (mediaServerConfig != null && mediaServerConfig.getInteger("code") == 0) { |
| | | logger.info("[zlmå¿è·³å°æ]ï¼{}éªè¯åzlmä»å¨çº¿ï¼æ¢å¤å¿è·³ä¿¡æ¯,è¯·æ£æ¥zlmæ¯å¦å¯ä»¥æ£å¸¸åwvpåéå¿è·³", serverItem.getId()); |
| | | // æ·»å zlmä¿¡æ¯ |
| | | logger.info("[åªä½æå¡èç¹å¿è·³å°æ]ï¼{}éªè¯ååªä½æå¡èç¹ä»å¨çº¿ï¼æ¢å¤å¿è·³ä¿¡æ¯,è¯·æ£æ¥åªä½æå¡èç¹æ¯å¦å¯ä»¥æ£å¸¸åwvpåéå¿è·³", serverItem.getId()); |
| | | // æ·»å åªä½æå¡èç¹ä¿¡æ¯ |
| | | updateMediaServerKeepalive(serverItem.getId(), null); |
| | | }else { |
| | | publisher.zlmOfflineEventPublish(serverItem.getId()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 对zlmæå¡å¨è¿è¡åºç¡é
ç½® |
| | | * 对åªä½æå¡èç¹æå¡å¨è¿è¡åºç¡é
ç½® |
| | | * @param mediaServerItem æå¡ID |
| | | * @param restart æ¯å¦éå¯zlm |
| | | * @param restart æ¯å¦éå¯åªä½æå¡èç¹ |
| | | */ |
| | | @Override |
| | | public void setZLMConfig(MediaServerItem mediaServerItem, boolean restart) { |
| | | logger.info("[ZLM] æ£å¨è®¾ç½® ï¼{} -> {}:{}", |
| | | logger.info("[åªä½æå¡èç¹] æ£å¨è®¾ç½® ï¼{} -> {}:{}", |
| | | mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort()); |
| | | String protocol = sslEnabled ? "https" : "http"; |
| | | String hookPrefix = String.format("%s://%s:%s/index/hook", protocol, mediaServerItem.getHookIp(), serverPort); |
| | |
| | | |
| | | if (responseJSON != null && responseJSON.getInteger("code") == 0) { |
| | | if (restart) { |
| | | logger.info("[ZLM] 设置æå,å¼å§éå¯ä»¥ä¿è¯é
ç½®çæ {} -> {}:{}", |
| | | logger.info("[åªä½æå¡èç¹] 设置æå,å¼å§éå¯ä»¥ä¿è¯é
ç½®çæ {} -> {}:{}", |
| | | mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort()); |
| | | zlmresTfulUtils.restartServer(mediaServerItem); |
| | | }else { |
| | | logger.info("[ZLM] 设置æå {} -> {}:{}", |
| | | logger.info("[åªä½æå¡èç¹] 设置æå {} -> {}:{}", |
| | | mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort()); |
| | | } |
| | | |
| | | |
| | | }else { |
| | | logger.info("[ZLM] 设置zlm失败 {} -> {}:{}", |
| | | logger.info("[åªä½æå¡èç¹] 设置åªä½æå¡èç¹å¤±è´¥ {} -> {}:{}", |
| | | mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort()); |
| | | } |
| | | |
| | |
| | | // ç¼åä¸åå¨ï¼ä»æ°æ®åºæ¥è¯¢ï¼å¦ææ°æ®åºä¸åå¨åæ¯é误ç |
| | | mediaServerItem = getOneFromDatabase(mediaServerId); |
| | | if (mediaServerItem == null) { |
| | | logger.warn("[æ´æ°ZLM ä¿æ´»ä¿¡æ¯] æµåªä½{}å°æªå å
¥ä½¿ç¨,è¯·æ£æ¥èç¹ä¸æ¯å¦å«ææ¤æµåªä½ ", mediaServerId); |
| | | logger.warn("[æ´æ°åªä½æå¡èç¹ ä¿æ´»ä¿¡æ¯] æµåªä½{}å°æªå å
¥ä½¿ç¨,è¯·æ£æ¥èç¹ä¸æ¯å¦å«ææ¤æµåªä½ ", mediaServerId); |
| | | return; |
| | | } |
| | | // zlmè¿æ¥éè¯ |
| | | logger.warn("[æ´æ°ZLM ä¿æ´»ä¿¡æ¯]å°è¯é¾æ¥zml id {}", mediaServerId); |
| | | // åªä½æå¡èç¹è¿æ¥éè¯ |
| | | logger.warn("[æ´æ°åªä½æå¡èç¹ ä¿æ´»ä¿¡æ¯]å°è¯é¾æ¥zml id {}", mediaServerId); |
| | | ssrcFactory.initMediaServerSSRC(mediaServerItem.getId(), null); |
| | | String key = VideoManagerConstants.MEDIA_SERVER_PREFIX + userSetting.getServerId() + "_" + mediaServerItem.getId(); |
| | | redisTemplate.opsForValue().set(key, mediaServerItem); |
| | |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
| | | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
| | | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
| | | import com.genersoft.iot.vmp.media.IMediaServerService;
|
| | | import com.genersoft.iot.vmp.media.zlm.dto.HookType;
|
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
| | | import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
|
| | |
| | | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.*; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.IStreamProxyService; |
| | | import com.genersoft.iot.vmp.service.IStreamPushService; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
New file |
| | |
| | | package com.genersoft.iot.vmp.media.zlm; |
| | | |
| | | import com.genersoft.iot.vmp.media.IMediaNodeServerService; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("zlm") |
| | | public class ZLMMediaNodeServerService implements IMediaNodeServerService { |
| | | } |
| | |
| | | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForServerStarted; |
| | | 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.media.IMediaServerService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Schema(description = "å½ååå¨è·¯å¾") |
| | | private String recordPath; |
| | | @Schema(description = "ç±»åï¼ zlm/abl") |
| | | private String type; |
| | | |
| | | public MediaServerItem() { |
| | | } |
| | |
| | | public void setRecordPath(String recordPath) { |
| | | this.recordPath = recordPath; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | } |
File was renamed from src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMEventAbstract.java |
| | |
| | | package com.genersoft.iot.vmp.media.zlm.event; |
| | | |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMServerConfig; |
| | | import org.springframework.context.ApplicationEvent; |
| | | |
| | | public abstract class ZLMEventAbstract extends ApplicationEvent { |
| | | public abstract class MediaServerEventAbstract extends ApplicationEvent { |
| | | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | private String mediaServerId; |
| | | |
| | | |
| | | public ZLMEventAbstract(Object source) { |
| | | public MediaServerEventAbstract(Object source) { |
| | | super(source); |
| | | } |
| | | |
New file |
| | |
| | | package com.genersoft.iot.vmp.media.zlm.event; |
| | | |
| | | /** |
| | | * zlm离线äºä»¶ç±» |
| | | */ |
| | | public class MediaServerOfflineEvent extends MediaServerEventAbstract { |
| | | |
| | | public MediaServerOfflineEvent(Object source) { |
| | | super(source); |
| | | } |
| | | } |
New file |
| | |
| | | package com.genersoft.iot.vmp.media.zlm.event; |
| | | |
| | | /** |
| | | * zlmå¨çº¿äºä»¶ |
| | | */ |
| | | public class MediaServerOnlineEvent extends MediaServerEventAbstract { |
| | | |
| | | public MediaServerOnlineEvent(Object source) { |
| | | super(source); |
| | | } |
| | | } |
File was renamed from src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMStatusEventListener.java |
| | |
| | | package com.genersoft.iot.vmp.media.zlm.event; |
| | | |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.IPlayService; |
| | | import com.genersoft.iot.vmp.service.IStreamProxyService; |
| | | import com.genersoft.iot.vmp.service.IStreamPushService; |
| | |
| | | * @date: 2020å¹´5æ6æ¥ ä¸å1:51:23 |
| | | */ |
| | | @Component |
| | | public class ZLMStatusEventListener { |
| | | public class MediaServerStatusEventListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(ZLMStatusEventListener.class); |
| | | private final static Logger logger = LoggerFactory.getLogger(MediaServerStatusEventListener.class); |
| | | |
| | | @Autowired |
| | | private IStreamPushService streamPushService; |
| | |
| | | |
| | | @Async("taskExecutor") |
| | | @EventListener |
| | | public void onApplicationEvent(ZLMOnlineEvent event) { |
| | | public void onApplicationEvent(MediaServerOnlineEvent event) { |
| | | logger.info("[ZLM] ä¸çº¿ IDï¼" + event.getMediaServerId()); |
| | | streamPushService.zlmServerOnline(event.getMediaServerId()); |
| | | streamProxyService.zlmServerOnline(event.getMediaServerId()); |
| | |
| | | |
| | | @Async("taskExecutor") |
| | | @EventListener |
| | | public void onApplicationEvent(ZLMOfflineEvent event) { |
| | | public void onApplicationEvent(MediaServerOfflineEvent event) { |
| | | |
| | | logger.info("[ZLM] 离线ï¼IDï¼" + event.getMediaServerId()); |
| | | // å¤çZLM离线 |
| | |
| | | import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.hook.OnRecordMp4HookParam; |
| | | import com.genersoft.iot.vmp.service.ICloudRecordService; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.bean.CloudRecordItem; |
| | | import com.genersoft.iot.vmp.service.bean.DownloadFileInfo; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | |
| | | import com.genersoft.iot.vmp.service.IDeviceChannelService; |
| | | import com.genersoft.iot.vmp.service.IDeviceService; |
| | | import com.genersoft.iot.vmp.service.IInviteStreamService; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | | import com.genersoft.iot.vmp.storager.dao.DeviceChannelMapper; |
| | | import com.genersoft.iot.vmp.storager.dao.DeviceMapper; |
| | |
| | | package com.genersoft.iot.vmp.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.genersoft.iot.vmp.common.StreamInfo; |
| | |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.IMediaService; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; |
| | |
| | | private IRedisCatchStorage redisCatchStorage; |
| | | |
| | | @Autowired |
| | | private IVideoManagerStorage storager; |
| | | |
| | | @Autowired |
| | | private IMediaServerService mediaServerService; |
| | | |
| | | |
| | | @Autowired |
| | | private MediaConfig mediaConfig; |
| | | |
| | | @Autowired |
| | | private ZLMRESTfulUtils zlmresTfulUtils; |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange; |
| | | import com.genersoft.iot.vmp.gb28181.utils.SipUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam; |
| | | import com.genersoft.iot.vmp.service.IInviteStreamService; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.IPlatformService; |
| | | import com.genersoft.iot.vmp.service.IPlayService; |
| | | import com.genersoft.iot.vmp.service.bean.*; |
| | |
| | | import com.genersoft.iot.vmp.utils.DateUtil; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import gov.nist.javax.sip.message.SIPRequest; |
| | | import gov.nist.javax.sip.message.SIPResponse; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | import javax.sdp.*; |
| | | import javax.sip.InvalidArgumentException; |
| | | import javax.sip.ResponseEvent; |
| | | import javax.sip.PeerUnavailableException; |
| | | import javax.sip.SipException; |
| | | import java.text.ParseException; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| | | import com.genersoft.iot.vmp.gb28181.utils.SipUtils; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| | |
| | | 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.gb28181.event.EventPublisher; |
| | | import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| | |
| | | import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam; |
| | | import com.genersoft.iot.vmp.service.IGbStreamService; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.IMediaService; |
| | | import com.genersoft.iot.vmp.service.IStreamProxyService; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; |
| | | import com.genersoft.iot.vmp.storager.dao.GbStreamMapper; |
| | | import com.genersoft.iot.vmp.storager.dao.ParentPlatformMapper; |
| | | import com.genersoft.iot.vmp.storager.dao.PlatformGbStreamMapper; |
| | | import com.genersoft.iot.vmp.storager.dao.StreamProxyMapper; |
| | | import com.genersoft.iot.vmp.utils.DateUtil; |
| | |
| | | import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.hook.OriginType; |
| | | import com.genersoft.iot.vmp.service.IGbStreamService; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.IStreamPushService; |
| | | import com.genersoft.iot.vmp.service.bean.StreamPushItemFromRedis; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | |
| | | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.bean.*; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | | import com.genersoft.iot.vmp.utils.redis.RedisUtil; |
| | |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.IStreamPushService; |
| | | import com.genersoft.iot.vmp.service.bean.MessageForPushChannel; |
| | | import com.genersoft.iot.vmp.service.bean.MessageForPushChannelResponse; |
| | |
| | | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; |
| | | import com.genersoft.iot.vmp.service.IGbStreamService; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.IStreamPushService; |
| | | import com.genersoft.iot.vmp.utils.DateUtil; |
| | | import org.slf4j.Logger; |
| | |
| | | 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 com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.bean.CloudRecordItem; |
| | | import com.genersoft.iot.vmp.service.bean.DownloadFileInfo; |
| | | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| | |
| | | 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; |
| | |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.service.IInviteStreamService; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.IMediaService; |
| | | import com.genersoft.iot.vmp.service.IPlayService; |
| | | import com.genersoft.iot.vmp.service.bean.InviteErrorCode; |
| | |
| | | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.hook.OnRtpServerTimeoutHookParam; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.utils.redis.RedisUtil; |
| | | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| | | import com.genersoft.iot.vmp.vmanager.bean.OtherPsSendInfo; |
| | |
| | | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.hook.OnRtpServerTimeoutHookParam; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.utils.redis.RedisUtil; |
| | | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| | | import com.genersoft.iot.vmp.vmanager.bean.OtherRtpSendInfo; |
| | |
| | | import com.genersoft.iot.vmp.conf.VersionInfo; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; |
| | | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.IHookSubscribe; |
| | |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| | | 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.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.IStreamProxyService; |
| | | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| | | import com.genersoft.iot.vmp.vmanager.bean.StreamContent; |
| | |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.IMediaService; |
| | | import com.genersoft.iot.vmp.service.IStreamPushService; |
| | | import com.genersoft.iot.vmp.service.impl.StreamPushUploadFileHandler; |
New file |
| | |
| | | /*建表*/ |
| | | create table wvp_device ( |
| | | id serial primary key , |
| | | device_id character varying(50) not null , |
| | | name character varying(255), |
| | | manufacturer character varying(255), |
| | | model character varying(255), |
| | | firmware character varying(255), |
| | | transport character varying(50), |
| | | stream_mode character varying(50), |
| | | on_line bool default false, |
| | | register_time character varying(50), |
| | | keepalive_time character varying(50), |
| | | ip character varying(50), |
| | | create_time character varying(50), |
| | | update_time character varying(50), |
| | | port integer, |
| | | expires integer, |
| | | subscribe_cycle_for_catalog integer DEFAULT 0, |
| | | subscribe_cycle_for_mobile_position integer DEFAULT 0, |
| | | mobile_position_submission_interval integer DEFAULT 5, |
| | | subscribe_cycle_for_alarm integer DEFAULT 0, |
| | | host_address character varying(50), |
| | | charset character varying(50), |
| | | ssrc_check bool default false, |
| | | geo_coord_sys character varying(50), |
| | | media_server_id character varying(50), |
| | | custom_name character varying(255), |
| | | sdp_ip character varying(50), |
| | | local_ip character varying(50), |
| | | password character varying(255), |
| | | as_message_channel bool default false, |
| | | keepalive_interval_time integer, |
| | | switch_primary_sub_stream bool default false, |
| | | broadcast_push_after_ack bool default false, |
| | | constraint uk_device_device unique (device_id) |
| | | ); |
| | | |
| | | create table wvp_device_alarm ( |
| | | id serial primary key , |
| | | device_id character varying(50) not null, |
| | | channel_id character varying(50) not null, |
| | | alarm_priority character varying(50), |
| | | alarm_method character varying(50), |
| | | alarm_time character varying(50), |
| | | alarm_description character varying(255), |
| | | longitude double precision, |
| | | latitude double precision, |
| | | alarm_type character varying(50), |
| | | create_time character varying(50) not null |
| | | ); |
| | | |
| | | create table wvp_device_channel ( |
| | | id serial primary key , |
| | | channel_id character varying(50) not null, |
| | | name character varying(255), |
| | | custom_name character varying(255), |
| | | manufacture character varying(50), |
| | | model character varying(50), |
| | | owner character varying(50), |
| | | civil_code character varying(50), |
| | | block character varying(50), |
| | | address character varying(50), |
| | | parent_id character varying(50), |
| | | safety_way integer, |
| | | register_way integer, |
| | | cert_num character varying(50), |
| | | certifiable integer, |
| | | err_code integer, |
| | | end_time character varying(50), |
| | | secrecy character varying(50), |
| | | ip_address character varying(50), |
| | | port integer, |
| | | password character varying(255), |
| | | ptz_type integer, |
| | | custom_ptz_type integer, |
| | | status bool default false, |
| | | longitude double precision, |
| | | custom_longitude double precision, |
| | | latitude double precision, |
| | | custom_latitude double precision, |
| | | stream_id character varying(255), |
| | | device_id character varying(50) not null, |
| | | parental character varying(50), |
| | | has_audio bool default false, |
| | | create_time character varying(50) not null, |
| | | update_time character varying(50) not null, |
| | | sub_count integer, |
| | | longitude_gcj02 double precision, |
| | | latitude_gcj02 double precision, |
| | | longitude_wgs84 double precision, |
| | | latitude_wgs84 double precision, |
| | | business_group_id character varying(50), |
| | | gps_time character varying(50), |
| | | stream_identification character varying(50), |
| | | constraint uk_wvp_device_channel_unique_device_channel unique (device_id, channel_id) |
| | | ); |
| | | |
| | | create table wvp_device_mobile_position ( |
| | | id serial primary key, |
| | | device_id character varying(50) not null, |
| | | channel_id character varying(50) not null, |
| | | device_name character varying(255), |
| | | time character varying(50), |
| | | longitude double precision, |
| | | latitude double precision, |
| | | altitude double precision, |
| | | speed double precision, |
| | | direction double precision, |
| | | report_source character varying(50), |
| | | longitude_gcj02 double precision, |
| | | latitude_gcj02 double precision, |
| | | longitude_wgs84 double precision, |
| | | latitude_wgs84 double precision, |
| | | create_time character varying(50) |
| | | ); |
| | | |
| | | create table wvp_gb_stream ( |
| | | gb_stream_id serial primary key, |
| | | app character varying(255) not null, |
| | | stream character varying(255) not null, |
| | | gb_id character varying(50) not null, |
| | | name character varying(255), |
| | | longitude double precision, |
| | | latitude double precision, |
| | | stream_type character varying(50), |
| | | media_server_id character varying(50), |
| | | create_time character varying(50), |
| | | constraint uk_gb_stream_unique_gb_id unique (gb_id), |
| | | constraint uk_gb_stream_unique_app_stream unique (app, stream) |
| | | ); |
| | | |
| | | create table wvp_log ( |
| | | id serial primary key , |
| | | name character varying(50), |
| | | type character varying(50), |
| | | uri character varying(200), |
| | | address character varying(50), |
| | | result character varying(50), |
| | | timing bigint, |
| | | username character varying(50), |
| | | create_time character varying(50) |
| | | ); |
| | | |
| | | create table wvp_media_server ( |
| | | id character varying(255) primary key , |
| | | ip character varying(50), |
| | | hook_ip character varying(50), |
| | | sdp_ip character varying(50), |
| | | stream_ip character varying(50), |
| | | http_port integer, |
| | | http_ssl_port integer, |
| | | rtmp_port integer, |
| | | rtmp_ssl_port integer, |
| | | rtp_proxy_port integer, |
| | | rtsp_port integer, |
| | | rtsp_ssl_port integer, |
| | | auto_config bool default false, |
| | | secret character varying(50), |
| | | type character varying(50) default 'zlm', |
| | | rtp_enable bool default false, |
| | | rtp_port_range character varying(50), |
| | | send_rtp_port_range character varying(50), |
| | | record_assist_port integer, |
| | | default_server bool default false, |
| | | create_time character varying(50), |
| | | update_time character varying(50), |
| | | hook_alive_interval integer, |
| | | record_path character varying(255), |
| | | record_day integer default 7, |
| | | constraint uk_media_server_unique_ip_http_port unique (ip, http_port) |
| | | ); |
| | | |
| | | create table wvp_platform ( |
| | | id serial primary key , |
| | | enable bool default false, |
| | | name character varying(255), |
| | | server_gb_id character varying(50), |
| | | server_gb_domain character varying(50), |
| | | server_ip character varying(50), |
| | | server_port integer, |
| | | device_gb_id character varying(50), |
| | | device_ip character varying(50), |
| | | device_port character varying(50), |
| | | username character varying(255), |
| | | password character varying(50), |
| | | expires character varying(50), |
| | | keep_timeout character varying(50), |
| | | transport character varying(50), |
| | | character_set character varying(50), |
| | | catalog_id character varying(50), |
| | | ptz bool default false, |
| | | rtcp bool default false, |
| | | status bool default false, |
| | | start_offline_push bool default false, |
| | | administrative_division character varying(50), |
| | | catalog_group integer, |
| | | create_time character varying(50), |
| | | update_time character varying(50), |
| | | as_message_channel bool default false, |
| | | auto_push_channel bool default false, |
| | | constraint uk_platform_unique_server_gb_id unique (server_gb_id) |
| | | ); |
| | | |
| | | create table wvp_platform_catalog ( |
| | | id character varying(50), |
| | | platform_id character varying(50), |
| | | name character varying(255), |
| | | parent_id character varying(50), |
| | | civil_code character varying(50), |
| | | business_group_id character varying(50), |
| | | constraint uk_platform_catalog_id_platform_id unique (id, platform_id) |
| | | ); |
| | | |
| | | create table wvp_platform_gb_channel ( |
| | | id serial primary key , |
| | | platform_id character varying(50), |
| | | catalog_id character varying(50), |
| | | device_channel_id integer, |
| | | constraint uk_platform_gb_channel_platform_id_catalog_id_device_channel_id unique (platform_id, catalog_id, device_channel_id) |
| | | ); |
| | | |
| | | create table wvp_platform_gb_stream ( |
| | | id serial primary key, |
| | | platform_id character varying(50), |
| | | catalog_id character varying(50), |
| | | gb_stream_id integer, |
| | | constraint uk_platform_gb_stream_platform_id_catalog_id_gb_stream_id unique (platform_id, catalog_id, gb_stream_id) |
| | | ); |
| | | |
| | | create table wvp_stream_proxy ( |
| | | id serial primary key, |
| | | type character varying(50), |
| | | app character varying(255), |
| | | stream character varying(255), |
| | | url character varying(255), |
| | | src_url character varying(255), |
| | | dst_url character varying(255), |
| | | timeout_ms integer, |
| | | ffmpeg_cmd_key character varying(255), |
| | | rtp_type character varying(50), |
| | | media_server_id character varying(50), |
| | | enable_audio bool default false, |
| | | enable_mp4 bool default false, |
| | | enable bool default false, |
| | | status boolean, |
| | | enable_remove_none_reader bool default false, |
| | | create_time character varying(50), |
| | | name character varying(255), |
| | | update_time character varying(50), |
| | | stream_key character varying(255), |
| | | enable_disable_none_reader bool default false, |
| | | constraint uk_stream_proxy_app_stream unique (app, stream) |
| | | ); |
| | | |
| | | create table wvp_stream_push ( |
| | | id serial primary key, |
| | | app character varying(255), |
| | | stream character varying(255), |
| | | total_reader_count character varying(50), |
| | | origin_type integer, |
| | | origin_type_str character varying(50), |
| | | create_time character varying(50), |
| | | alive_second integer, |
| | | media_server_id character varying(50), |
| | | server_id character varying(50), |
| | | push_time character varying(50), |
| | | status bool default false, |
| | | update_time character varying(50), |
| | | push_ing bool default false, |
| | | self bool default false, |
| | | constraint uk_stream_push_app_stream unique (app, stream) |
| | | ); |
| | | create table wvp_cloud_record ( |
| | | id serial primary key, |
| | | app character varying(255), |
| | | stream character varying(255), |
| | | call_id character varying(255), |
| | | start_time bigint, |
| | | end_time bigint, |
| | | media_server_id character varying(50), |
| | | file_name character varying(255), |
| | | folder character varying(255), |
| | | file_path character varying(255), |
| | | collect bool default false, |
| | | file_size bigint, |
| | | time_len bigint, |
| | | constraint uk_stream_push_app_stream_path unique (app, stream, file_path) |
| | | ); |
| | | |
| | | create table wvp_user ( |
| | | id serial primary key, |
| | | username character varying(255), |
| | | password character varying(255), |
| | | role_id integer, |
| | | create_time character varying(50), |
| | | update_time character varying(50), |
| | | push_key character varying(50), |
| | | constraint uk_user_username unique (username) |
| | | ); |
| | | |
| | | create table wvp_user_role ( |
| | | id serial primary key, |
| | | name character varying(50), |
| | | authority character varying(50), |
| | | create_time character varying(50), |
| | | update_time character varying(50) |
| | | ); |
| | | create table wvp_resources_tree ( |
| | | id serial primary key , |
| | | is_catalog bool default true, |
| | | device_channel_id integer , |
| | | gb_stream_id integer, |
| | | name character varying(255), |
| | | parentId integer, |
| | | path character varying(255) |
| | | ); |
| | | |
| | | |
| | | /*åå§æ°æ®*/ |
| | | INSERT INTO wvp_user VALUES (1, 'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021-04-13 14:14:57','2021-04-13 14:14:57','3e80d1762a324d5b0ff636e0bd16f1e3'); |
| | | INSERT INTO wvp_user_role VALUES (1, 'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57'); |
| | | |
| | | |
| | | |
New file |
| | |
| | | /*建表*/ |
| | | create table wvp_device ( |
| | | id serial primary key , |
| | | device_id character varying(50) not null , |
| | | name character varying(255), |
| | | manufacturer character varying(255), |
| | | model character varying(255), |
| | | firmware character varying(255), |
| | | transport character varying(50), |
| | | stream_mode character varying(50), |
| | | on_line bool default false, |
| | | register_time character varying(50), |
| | | keepalive_time character varying(50), |
| | | ip character varying(50), |
| | | create_time character varying(50), |
| | | update_time character varying(50), |
| | | port integer, |
| | | expires integer, |
| | | subscribe_cycle_for_catalog integer DEFAULT 0, |
| | | subscribe_cycle_for_mobile_position integer DEFAULT 0, |
| | | mobile_position_submission_interval integer DEFAULT 5, |
| | | subscribe_cycle_for_alarm integer DEFAULT 0, |
| | | host_address character varying(50), |
| | | charset character varying(50), |
| | | ssrc_check bool default false, |
| | | geo_coord_sys character varying(50), |
| | | media_server_id character varying(50), |
| | | custom_name character varying(255), |
| | | sdp_ip character varying(50), |
| | | local_ip character varying(50), |
| | | password character varying(255), |
| | | as_message_channel bool default false, |
| | | keepalive_interval_time integer, |
| | | switch_primary_sub_stream bool default false, |
| | | broadcast_push_after_ack bool default false, |
| | | constraint uk_device_device unique (device_id) |
| | | ); |
| | | |
| | | create table wvp_device_alarm ( |
| | | id serial primary key , |
| | | device_id character varying(50) not null, |
| | | channel_id character varying(50) not null, |
| | | alarm_priority character varying(50), |
| | | alarm_method character varying(50), |
| | | alarm_time character varying(50), |
| | | alarm_description character varying(255), |
| | | longitude double precision, |
| | | latitude double precision, |
| | | alarm_type character varying(50), |
| | | create_time character varying(50) not null |
| | | ); |
| | | |
| | | create table wvp_device_channel ( |
| | | id serial primary key , |
| | | channel_id character varying(50) not null, |
| | | name character varying(255), |
| | | custom_name character varying(255), |
| | | manufacture character varying(50), |
| | | model character varying(50), |
| | | owner character varying(50), |
| | | civil_code character varying(50), |
| | | block character varying(50), |
| | | address character varying(50), |
| | | parent_id character varying(50), |
| | | safety_way integer, |
| | | register_way integer, |
| | | cert_num character varying(50), |
| | | certifiable integer, |
| | | err_code integer, |
| | | end_time character varying(50), |
| | | secrecy character varying(50), |
| | | ip_address character varying(50), |
| | | port integer, |
| | | password character varying(255), |
| | | ptz_type integer, |
| | | custom_ptz_type integer, |
| | | status bool default false, |
| | | longitude double precision, |
| | | custom_longitude double precision, |
| | | latitude double precision, |
| | | custom_latitude double precision, |
| | | stream_id character varying(255), |
| | | device_id character varying(50) not null, |
| | | parental character varying(50), |
| | | has_audio bool default false, |
| | | create_time character varying(50) not null, |
| | | update_time character varying(50) not null, |
| | | sub_count integer, |
| | | longitude_gcj02 double precision, |
| | | latitude_gcj02 double precision, |
| | | longitude_wgs84 double precision, |
| | | latitude_wgs84 double precision, |
| | | business_group_id character varying(50), |
| | | gps_time character varying(50), |
| | | stream_identification character varying(50), |
| | | constraint uk_wvp_device_channel_unique_device_channel unique (device_id, channel_id) |
| | | ); |
| | | |
| | | create table wvp_device_mobile_position ( |
| | | id serial primary key, |
| | | device_id character varying(50) not null, |
| | | channel_id character varying(50) not null, |
| | | device_name character varying(255), |
| | | time character varying(50), |
| | | longitude double precision, |
| | | latitude double precision, |
| | | altitude double precision, |
| | | speed double precision, |
| | | direction double precision, |
| | | report_source character varying(50), |
| | | longitude_gcj02 double precision, |
| | | latitude_gcj02 double precision, |
| | | longitude_wgs84 double precision, |
| | | latitude_wgs84 double precision, |
| | | create_time character varying(50) |
| | | ); |
| | | |
| | | create table wvp_gb_stream ( |
| | | gb_stream_id serial primary key, |
| | | app character varying(255) not null, |
| | | stream character varying(255) not null, |
| | | gb_id character varying(50) not null, |
| | | name character varying(255), |
| | | longitude double precision, |
| | | latitude double precision, |
| | | stream_type character varying(50), |
| | | media_server_id character varying(50), |
| | | create_time character varying(50), |
| | | constraint uk_gb_stream_unique_gb_id unique (gb_id), |
| | | constraint uk_gb_stream_unique_app_stream unique (app, stream) |
| | | ); |
| | | |
| | | create table wvp_log ( |
| | | id serial primary key , |
| | | name character varying(50), |
| | | type character varying(50), |
| | | uri character varying(200), |
| | | address character varying(50), |
| | | result character varying(50), |
| | | timing bigint, |
| | | username character varying(50), |
| | | create_time character varying(50) |
| | | ); |
| | | |
| | | create table wvp_media_server ( |
| | | id character varying(255) primary key , |
| | | ip character varying(50), |
| | | hook_ip character varying(50), |
| | | sdp_ip character varying(50), |
| | | stream_ip character varying(50), |
| | | http_port integer, |
| | | http_ssl_port integer, |
| | | rtmp_port integer, |
| | | rtmp_ssl_port integer, |
| | | rtp_proxy_port integer, |
| | | rtsp_port integer, |
| | | rtsp_ssl_port integer, |
| | | auto_config bool default false, |
| | | secret character varying(50), |
| | | type character varying(50) default 'zlm', |
| | | rtp_enable bool default false, |
| | | rtp_port_range character varying(50), |
| | | send_rtp_port_range character varying(50), |
| | | record_assist_port integer, |
| | | default_server bool default false, |
| | | create_time character varying(50), |
| | | update_time character varying(50), |
| | | hook_alive_interval integer, |
| | | record_path character varying(255), |
| | | record_day integer default 7, |
| | | constraint uk_media_server_unique_ip_http_port unique (ip, http_port) |
| | | ); |
| | | |
| | | create table wvp_platform ( |
| | | id serial primary key , |
| | | enable bool default false, |
| | | name character varying(255), |
| | | server_gb_id character varying(50), |
| | | server_gb_domain character varying(50), |
| | | server_ip character varying(50), |
| | | server_port integer, |
| | | device_gb_id character varying(50), |
| | | device_ip character varying(50), |
| | | device_port character varying(50), |
| | | username character varying(255), |
| | | password character varying(50), |
| | | expires character varying(50), |
| | | keep_timeout character varying(50), |
| | | transport character varying(50), |
| | | character_set character varying(50), |
| | | catalog_id character varying(50), |
| | | ptz bool default false, |
| | | rtcp bool default false, |
| | | status bool default false, |
| | | start_offline_push bool default false, |
| | | administrative_division character varying(50), |
| | | catalog_group integer, |
| | | create_time character varying(50), |
| | | update_time character varying(50), |
| | | as_message_channel bool default false, |
| | | auto_push_channel bool default false, |
| | | constraint uk_platform_unique_server_gb_id unique (server_gb_id) |
| | | ); |
| | | |
| | | create table wvp_platform_catalog ( |
| | | id character varying(50), |
| | | platform_id character varying(50), |
| | | name character varying(255), |
| | | parent_id character varying(50), |
| | | civil_code character varying(50), |
| | | business_group_id character varying(50), |
| | | constraint uk_platform_catalog_id_platform_id unique (id, platform_id) |
| | | ); |
| | | |
| | | create table wvp_platform_gb_channel ( |
| | | id serial primary key , |
| | | platform_id character varying(50), |
| | | catalog_id character varying(50), |
| | | device_channel_id integer, |
| | | constraint uk_platform_gb_channel_platform_id_catalog_id_device_channel_id unique (platform_id, catalog_id, device_channel_id) |
| | | ); |
| | | |
| | | create table wvp_platform_gb_stream ( |
| | | id serial primary key, |
| | | platform_id character varying(50), |
| | | catalog_id character varying(50), |
| | | gb_stream_id integer, |
| | | constraint uk_platform_gb_stream_platform_id_catalog_id_gb_stream_id unique (platform_id, catalog_id, gb_stream_id) |
| | | ); |
| | | |
| | | create table wvp_stream_proxy ( |
| | | id serial primary key, |
| | | type character varying(50), |
| | | app character varying(255), |
| | | stream character varying(255), |
| | | url character varying(255), |
| | | src_url character varying(255), |
| | | dst_url character varying(255), |
| | | timeout_ms integer, |
| | | ffmpeg_cmd_key character varying(255), |
| | | rtp_type character varying(50), |
| | | media_server_id character varying(50), |
| | | enable_audio bool default false, |
| | | enable_mp4 bool default false, |
| | | enable bool default false, |
| | | status boolean, |
| | | enable_remove_none_reader bool default false, |
| | | create_time character varying(50), |
| | | name character varying(255), |
| | | update_time character varying(50), |
| | | stream_key character varying(255), |
| | | enable_disable_none_reader bool default false, |
| | | constraint uk_stream_proxy_app_stream unique (app, stream) |
| | | ); |
| | | |
| | | create table wvp_stream_push ( |
| | | id serial primary key, |
| | | app character varying(255), |
| | | stream character varying(255), |
| | | total_reader_count character varying(50), |
| | | origin_type integer, |
| | | origin_type_str character varying(50), |
| | | create_time character varying(50), |
| | | alive_second integer, |
| | | media_server_id character varying(50), |
| | | server_id character varying(50), |
| | | push_time character varying(50), |
| | | status bool default false, |
| | | update_time character varying(50), |
| | | push_ing bool default false, |
| | | self bool default false, |
| | | constraint uk_stream_push_app_stream unique (app, stream) |
| | | ); |
| | | create table wvp_cloud_record ( |
| | | id serial primary key, |
| | | app character varying(255), |
| | | stream character varying(255), |
| | | call_id character varying(255), |
| | | start_time int8, |
| | | end_time int8, |
| | | media_server_id character varying(50), |
| | | file_name character varying(255), |
| | | folder character varying(255), |
| | | file_path character varying(255), |
| | | collect bool default false, |
| | | file_size int8, |
| | | time_len int8, |
| | | constraint uk_stream_push_app_stream_path unique (app, stream, file_path) |
| | | ); |
| | | |
| | | create table wvp_user ( |
| | | id serial primary key, |
| | | username character varying(255), |
| | | password character varying(255), |
| | | role_id integer, |
| | | create_time character varying(50), |
| | | update_time character varying(50), |
| | | push_key character varying(50), |
| | | constraint uk_user_username unique (username) |
| | | ); |
| | | |
| | | create table wvp_user_role ( |
| | | id serial primary key, |
| | | name character varying(50), |
| | | authority character varying(50), |
| | | create_time character varying(50), |
| | | update_time character varying(50) |
| | | ); |
| | | create table wvp_resources_tree ( |
| | | id serial primary key , |
| | | is_catalog bool default true, |
| | | device_channel_id integer , |
| | | gb_stream_id integer, |
| | | name character varying(255), |
| | | parentId integer, |
| | | path character varying(255) |
| | | ); |
| | | |
| | | |
| | | /*åå§æ°æ®*/ |
| | | INSERT INTO wvp_user VALUES (1, 'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021-04-13 14:14:57','2021-04-13 14:14:57','3e80d1762a324d5b0ff636e0bd16f1e3'); |
| | | INSERT INTO wvp_user_role VALUES (1, 'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57'); |
| | | |
| | | |
| | | |
New file |
| | |
| | | alter table wvp_media_server |
| | | add type character varying(50) default 'zlm',; |
New file |
| | |
| | | alter table wvp_media_server |
| | | add type character varying(50) default 'zlm',; |