Merge branch 'wvp-28181-2.0'
# Conflicts:
# src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java
# src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java
# src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
| | |
| | | /** |
| | | * 设å¤å½æ ç¼å· |
| | | */ |
| | | @Schema(description = "11111") |
| | | @Schema(description = "设å¤å½æ ç¼å·") |
| | | private String deviceGBId; |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * RTCPæµä¿æ´» |
| | | * TODO é¢ç, æä¸å®ç° |
| | | */ |
| | | @Schema(description = "RTCPæµä¿æ´»") |
| | | private boolean rtcp; |
| | |
| | | * @param startTime å¼å§æ¶é´,æ ¼å¼è¦æ±ï¼yyyy-MM-dd HH:mm:ss
|
| | | * @param endTime ç»ææ¶é´,æ ¼å¼è¦æ±ï¼yyyy-MM-dd HH:mm:ss
|
| | | */
|
| | | void playbackStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInf, Device device, String channelId, String startTime, String endTime,InviteStreamCallback inviteStreamCallback, InviteStreamCallback event, SipSubscribe.Event errorEvent);
|
| | | void playbackStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInf, Device device, String channelId, String startTime, String endTime,InviteStreamCallback inviteStreamCallback, InviteStreamCallback event, SipSubscribe.Event okEvent, SipSubscribe.Event errorEvent);
|
| | |
|
| | | /**
|
| | | * 请æ±åå²åªä½ä¸è½½
|
| | |
| | | // String streamMode = device.getStreamMode().toUpperCase();
|
| | |
|
| | | logger.info("{} åé
çZLM为: {} [{}:{}]", stream, mediaServerItem.getId(), mediaServerItem.getIp(), ssrcInfo.getPort());
|
| | | HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed("rtp", stream, true, "rtmp", mediaServerItem.getId());
|
| | | HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed("rtp", stream, true, "rtsp", mediaServerItem.getId());
|
| | | subscribe.addSubscribe(hookSubscribe, (MediaServerItem mediaServerItemInUse, JSONObject json)->{
|
| | | if (event != null) {
|
| | | event.response(mediaServerItemInUse, json);
|
| | |
| | | @Override
|
| | | public void playbackStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId,
|
| | | String startTime, String endTime, InviteStreamCallback inviteStreamCallback, InviteStreamCallback hookEvent,
|
| | | SipSubscribe.Event errorEvent) {
|
| | | SipSubscribe.Event okEvent,SipSubscribe.Event errorEvent) {
|
| | | try {
|
| | |
|
| | | logger.info("{} åé
çZLM为: {} [{}:{}]", ssrcInfo.getStream(), mediaServerItem.getId(), mediaServerItem.getIp(), ssrcInfo.getPort());
|
| | |
| | |
|
| | | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId()
|
| | | : udpSipProvider.getNewCallId();
|
| | | HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed("rtp", ssrcInfo.getStream(), true, "rtmp", mediaServerItem.getId());
|
| | | HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed("rtp", ssrcInfo.getStream(), true, "rtsp", mediaServerItem.getId());
|
| | | // æ·»å 订é
|
| | | subscribe.addSubscribe(hookSubscribe, (MediaServerItem mediaServerItemInUse, JSONObject json)->{
|
| | | if (hookEvent != null) {
|
| | |
| | | });
|
| | | Request request = headerProvider.createPlaybackInviteRequest(device, channelId, content.toString(), null, "fromplybck" + tm, null, callIdHeader, ssrcInfo.getSsrc());
|
| | |
|
| | | transmitRequest(device, request, errorEvent, okEvent -> {
|
| | | ResponseEvent responseEvent = (ResponseEvent) okEvent.event;
|
| | | transmitRequest(device, request, errorEvent, event -> {
|
| | | ResponseEvent responseEvent = (ResponseEvent) event.event;
|
| | | streamSession.put(device.getDeviceId(), channelId, callIdHeader.getCallId(), ssrcInfo.getStream(), ssrcInfo.getSsrc(), mediaServerItem.getId(), responseEvent.getClientTransaction(), VideoStreamSessionManager.SessionType.playback);
|
| | | streamSession.put(device.getDeviceId(), channelId, callIdHeader.getCallId(), okEvent.dialog);
|
| | | streamSession.put(device.getDeviceId(), channelId, callIdHeader.getCallId(), event.dialog);
|
| | | okEvent.response(event);
|
| | | });
|
| | | if (inviteStreamCallback != null) {
|
| | | inviteStreamCallback.call(new InviteStreamInfo(mediaServerItem, null, callIdHeader.getCallId(), "rtp", ssrcInfo.getStream()));
|
| | |
| | | param.put("pt", sendRtpItem.getPt()); |
| | | param.put("use_ps", sendRtpItem.isUsePs() ? "1" : "0"); |
| | | param.put("only_audio", sendRtpItem.isOnlyAudio() ? "1" : "0"); |
| | | if (!sendRtpItem.isTcp() && parentPlatform.isRtcp()) { |
| | | // å¼å¯rtcpä¿æ´» |
| | | param.put("udp_rtcp_timeout", "1"); |
| | | } |
| | | JSONObject jsonObject; |
| | | if (sendRtpItem.isTcpActive()) { |
| | | jsonObject = zlmrtpServerFactory.startSendRtpPassive(mediaInfo, param); |
| | |
| | | MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId()); |
| | | zlmrtpServerFactory.stopSendRtpStream(mediaInfo, param); |
| | | redisCatchStorage.deleteSendRTPServer(platformGbId, sendRtpItem.getChannelId(), callIdHeader.getCallId(), null); |
| | | redisCatchStorage.deleteSendRTPServer(platformGbId, channelId, callIdHeader.getCallId(), null); |
| | | zlmrtpServerFactory.stopSendRtpStream(mediaInfo, param); |
| | | int totalReaderCount = zlmrtpServerFactory.totalReaderCount(mediaInfo, sendRtpItem.getApp(), streamId); |
| | | if (totalReaderCount <= 0) { |
| | | logger.info("æ¶å°bye: {} æ å
¶å®è§çè
ï¼éç¥è®¾å¤åæ¢æ¨æµ", streamId); |
| | |
| | | private ZLMRESTfulUtils zlmresTfulUtils; |
| | | |
| | | @Autowired |
| | | private ZlmHttpHookSubscribe zlmHttpHookSubscribe; |
| | | |
| | | @Autowired |
| | | private SIPProcessorObserver sipProcessorObserver; |
| | | |
| | | @Autowired |
| | |
| | | if (playTransaction != null) { |
| | | Boolean streamReady = zlmrtpServerFactory.isStreamReady(mediaServerItem, "rtp", playTransaction.getStream()); |
| | | if (!streamReady) { |
| | | playTransaction = null; |
| | | boolean hasRtpServer = mediaServerService.checkRtpServer(mediaServerItem, "rtp", playTransaction.getStream()); |
| | | if (hasRtpServer) { |
| | | logger.info("[ä¸çº§ç¹æ]å·²ç»å¼å¯rtpServer使¯å°æªæ¶å°æµï¼å¼å¯ç嬿µçå°æ¥"); |
| | | HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed("rtp", playTransaction.getStream(), true, "rtsp", mediaServerItem.getId()); |
| | | zlmHttpHookSubscribe.addSubscribe(hookSubscribe, hookEvent); |
| | | }else { |
| | | playTransaction = null; |
| | | } |
| | | } |
| | | } |
| | | if (playTransaction == null) { |
| | |
| | | responseAck(evt, Response.BAD_REQUEST, "channel [" + gbStream.getGbId() + "] offline"); |
| | | } else if ("push".equals(gbStream.getStreamType())) { |
| | | if (!platform.isStartOfflinePush()) { |
| | | responseAck(evt, Response.TEMPORARILY_UNAVAILABLE, "channel unavailable"); |
| | | // å¹³å°è®¾ç½®ä¸å
³éäºæèµ·ç¦»çº¿çæ¨æµåç´æ¥åå¤ |
| | | responseAck(evt, Response.TEMPORARILY_UNAVAILABLE, "channel stream not pushing"); |
| | | return; |
| | | } |
| | | // åéredisæ¶æ¯ä»¥ä½¿è®¾å¤ä¸çº¿ |
| | |
| | | app, stream, channelId, mediaTransmissionTCP); |
| | | |
| | | if (sendRtpItem == null) { |
| | | logger.warn("æå¡å¨ç«¯å£èµæºä¸è¶³"); |
| | | logger.warn("ä¸çº§ç¹æ¶å建sendRTPItem失败ï¼å¯è½æ¯æå¡å¨ç«¯å£èµæºä¸è¶³"); |
| | | try { |
| | | responseAck(evt, Response.BUSY_HERE); |
| | | } catch (SipException e) { |
| | |
| | | }else if (subscribeInfo.getExpires() == 0) { |
| | | subscribeHolder.removeCatalogSubscribe(platformId); |
| | | } |
| | | |
| | | try { |
| | | ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(platformId); |
| | | responseXmlAck(evt, resultXml.toString(), parentPlatform); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | return null;
|
| | | }
|
| | | deviceChannel.setChannelId(channelId);
|
| | | int channelTypeCode = Integer.parseInt(channelId.substring(10, 13));
|
| | | if (channelTypeCode == 136 || channelTypeCode == 137 || channelTypeCode == 138) {
|
| | | deviceChannel.setHasAudio(true);
|
| | | }else {
|
| | | deviceChannel.setHasAudio(false);
|
| | | }
|
| | | if (event != null && !event.equals(CatalogEvent.ADD) && !event.equals(CatalogEvent.UPDATE)) {
|
| | | // é¤äºADDåupdateæ
åµä¸éè¦è¯å«å
¨é¨å
容ï¼
|
| | | return deviceChannel;
|
| | |
| | | } else {
|
| | | deviceChannel.setPTZType(Integer.parseInt(XmlUtil.getText(itemDevice, "PTZType")));
|
| | | }
|
| | | deviceChannel.setHasAudio(true); // é»è®¤å«æé³é¢ï¼ææ¾æ¶åæ£æ¥æ¯å¦æé³é¢åæ¯å¦AAC
|
| | | return deviceChannel;
|
| | | }
|
| | | } |
| | |
| | | if (mediaServerItem == null) { |
| | | return null; |
| | | } |
| | | if (mediaServerItem.getRecordAssistPort() > 0) { |
| | | if (mediaServerItem.getRecordAssistPort() <= 0) { |
| | | logger.warn("æªå¯ç¨Assistæå¡"); |
| | | return null; |
| | | } |
| | |
| | | import org.slf4j.LoggerFactory;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.beans.factory.annotation.Qualifier;
|
| | | import org.springframework.http.HttpStatus;
|
| | | import org.springframework.http.ResponseEntity;
|
| | | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
| | | import org.springframework.util.ObjectUtils;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | |
| | | for (SendRtpItem sendRtpItem : sendRtpItems) {
|
| | | ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId());
|
| | | commanderFroPlatform.streamByeCmd(parentPlatform, sendRtpItem.getCallId());
|
| | | redisCatchStorage.deleteSendRTPServer(parentPlatform.getServerGBId(), sendRtpItem.getChannelId(),
|
| | | sendRtpItem.getCallId(), sendRtpItem.getStreamId());
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | return ret;
|
| | | }else {
|
| | | StreamProxyItem streamProxyItem = streamProxyService.getStreamProxyByAppAndStream(app, streamId);
|
| | | if (streamProxyItem != null && streamProxyItem.isEnable_remove_none_reader()) {
|
| | | ret.put("close", true);
|
| | | streamProxyService.del(app, streamId);
|
| | | String url = streamProxyItem.getUrl() != null?streamProxyItem.getUrl():streamProxyItem.getSrc_url();
|
| | | logger.info("[{}/{}]<-[{}] ææµä»£çæ äººè§çå·²ç»ç§»é¤", app, streamId, url);
|
| | | }else {
|
| | | ret.put("close", false);
|
| | | if (streamProxyItem != null ) {
|
| | | if (streamProxyItem.isEnable_remove_none_reader()) {
|
| | | // æ 人è§çèªå¨ç§»é¤
|
| | | ret.put("close", true);
|
| | | streamProxyService.del(app, streamId);
|
| | | String url = streamProxyItem.getUrl() != null?streamProxyItem.getUrl():streamProxyItem.getSrc_url();
|
| | | logger.info("[{}/{}]<-[{}] ææµä»£çæ äººè§çå·²ç»ç§»é¤", app, streamId, url);
|
| | | }else if (streamProxyItem.isEnable_disable_none_reader()) {
|
| | | // æ 人è§çåç¨
|
| | | ret.put("close", true);
|
| | | }else {
|
| | | ret.put("close", false);
|
| | | }
|
| | | }
|
| | | return ret;
|
| | | }
|
| | |
| | | @ResponseBody
|
| | | @PostMapping(value = "/on_server_started", produces = "application/json;charset=UTF-8")
|
| | | public JSONObject onServerStarted(HttpServletRequest request, @RequestBody JSONObject jsonObject){
|
| | | |
| | |
|
| | | if (logger.isDebugEnabled()) {
|
| | | logger.debug("[ ZLM HOOK ]on_server_started APIè°ç¨ï¼åæ°ï¼" + jsonObject.toString());
|
| | | }
|
| | |
| | | return ret;
|
| | | }
|
| | |
|
| | | /**
|
| | | * åértp(startSendRtp)被å¨å
³éæ¶åè°
|
| | | */
|
| | | @ResponseBody
|
| | | @PostMapping(value = "/on_send_rtp_stopped", produces = "application/json;charset=UTF-8")
|
| | | public JSONObject onSendRtpStopped(HttpServletRequest request, @RequestBody JSONObject jsonObject){
|
| | |
|
| | | logger.info("[ ZLM HOOK ]on_send_rtp_stopped APIè°ç¨ï¼åæ°ï¼" + jsonObject);
|
| | |
|
| | | JSONObject ret = new JSONObject();
|
| | | ret.put("code", 0);
|
| | | ret.put("msg", "success");
|
| | |
|
| | | // æ¥æ¾å¯¹åºçä¸çº§æ¨æµï¼åé忢
|
| | | String app = jsonObject.getString("app");
|
| | | if (!"rtp".equals(app)) {
|
| | | return ret;
|
| | | }
|
| | | String stream = jsonObject.getString("stream");
|
| | | List<SendRtpItem> sendRtpItems = redisCatchStorage.querySendRTPServerByStream(stream);
|
| | | if (sendRtpItems.size() > 0) {
|
| | | for (SendRtpItem sendRtpItem : sendRtpItems) {
|
| | | ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId());
|
| | | commanderFroPlatform.streamByeCmd(parentPlatform, sendRtpItem.getCallId());
|
| | | redisCatchStorage.deleteSendRTPServer(parentPlatform.getServerGBId(), sendRtpItem.getChannelId(),
|
| | | sendRtpItem.getCallId(), sendRtpItem.getStreamId());
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | return ret;
|
| | | }
|
| | |
|
| | | private Map<String, String> urlParamToMap(String params) {
|
| | | HashMap<String, String> map = new HashMap<>();
|
| | | if (ObjectUtils.isEmpty(params)) {
|
| | |
| | | if(rtpInfo.getInteger("code") == 0){ |
| | | if (rtpInfo.getBoolean("exist")) { |
| | | result = rtpInfo.getInteger("local_port"); |
| | | if (result == 0) { |
| | | // æ¤æ¶è¯´ærtpServerå·²ç»åå»ºä½æ¯æµè¿æ²¡ææ¨ä¸æ¥ |
| | | |
| | | } |
| | | return result; |
| | | } |
| | | }else if(rtpInfo.getInteger("code") == -2){ |
| | |
| | | private boolean enable_mp4; |
| | | @Schema(description = "æ¯å¦ æ 人è§çæ¶å é¤") |
| | | private boolean enable_remove_none_reader; |
| | | |
| | | @Schema(description = "æ¯å¦ æ 人è§çæ¶ä¸å¯ç¨") |
| | | private boolean enable_disable_none_reader; |
| | | @Schema(description = "ä¸çº§å¹³å°å½æ ID") |
| | | private String platformGbId; |
| | | @Schema(description = "å建æ¶é´") |
| | |
| | | this.enable_remove_none_reader = enable_remove_none_reader; |
| | | } |
| | | |
| | | public boolean isEnable_disable_none_reader() { |
| | | return enable_disable_none_reader; |
| | | } |
| | | |
| | | public void setEnable_disable_none_reader(boolean enable_disable_none_reader) { |
| | | this.enable_disable_none_reader = enable_disable_none_reader; |
| | | } |
| | | } |
| | |
| | | MediaServerItem getDefaultMediaServer(); |
| | | |
| | | void updateMediaServerKeepalive(String mediaServerId, JSONObject data); |
| | | |
| | | boolean checkRtpServer(MediaServerItem mediaServerItem, String rtp, String stream); |
| | | } |
| | |
| | | if (streamId == null) { |
| | | streamId = String.format("%08x", Integer.parseInt(ssrc)).toUpperCase(); |
| | | } |
| | | int rtpServerPort = mediaServerItem.getRtpProxyPort(); |
| | | int rtpServerPort; |
| | | if (mediaServerItem.isRtpEnable()) { |
| | | rtpServerPort = zlmrtpServerFactory.createRTPServer(mediaServerItem, streamId, ssrcCheck?Integer.parseInt(ssrc):0, port); |
| | | } else { |
| | | rtpServerPort = mediaServerItem.getRtpProxyPort(); |
| | | } |
| | | RedisUtil.set(key, mediaServerItem); |
| | | return new SSRCInfo(rtpServerPort, ssrc, streamId); |
| | |
| | | param.put("hook.on_stream_none_reader",String.format("%s/on_stream_none_reader", hookPrex)); |
| | | param.put("hook.on_stream_not_found",String.format("%s/on_stream_not_found", hookPrex)); |
| | | param.put("hook.on_server_keepalive",String.format("%s/on_server_keepalive", hookPrex)); |
| | | param.put("hook.on_send_rtp_stopped",String.format("%s/on_send_rtp_stopped", hookPrex)); |
| | | if (mediaServerItem.getRecordAssistPort() > 0) { |
| | | param.put("hook.on_record_mp4",String.format("http://127.0.0.1:%s/api/record/on_record_mp4", mediaServerItem.getRecordAssistPort())); |
| | | }else { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean checkRtpServer(MediaServerItem mediaServerItem, String app, String stream) { |
| | | JSONObject rtpInfo = zlmresTfulUtils.getRtpInfo(mediaServerItem, stream); |
| | | if(rtpInfo.getInteger("code") == 0){ |
| | | return rtpInfo.getBoolean("exist"); |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | |
| | | }else { |
| | | streamInfo = getStreamInfoByAppAndStream(mediaInfo, app, stream, tracks, addr,null, true); |
| | | } |
| | | |
| | | } |
| | | } |
| | | return streamInfo; |
| | |
| | | JSONObject rtpInfo = zlmresTfulUtils.getRtpInfo(mediaInfo, streamId); |
| | | if(rtpInfo.getInteger("code") == 0){ |
| | | if (rtpInfo.getBoolean("exist")) { |
| | | int localPort = rtpInfo.getInteger("local_port"); |
| | | if (localPort == 0) { |
| | | logger.warn("[ç¹æ]ï¼ç¹ææ¶åç°rtpServerCåå¨ï¼ä½æ¯å°æªå¼å§æ¨æµ"); |
| | | // æ¤æ¶è¯´ærtpServerå·²ç»åå»ºä½æ¯æµè¿æ²¡ææ¨ä¸æ¥ |
| | | WVPResult wvpResult = new WVPResult(); |
| | | wvpResult.setCode(ErrorCode.ERROR100.getCode()); |
| | | wvpResult.setMsg("ç¹æå·²ç»å¨è¿è¡ä¸ï¼è¯·ç¨åéè¯"); |
| | | msg.setData(wvpResult); |
| | | |
| | | WVPResult wvpResult = new WVPResult(); |
| | | wvpResult.setCode(ErrorCode.SUCCESS.getCode()); |
| | | wvpResult.setMsg(ErrorCode.SUCCESS.getMsg()); |
| | | wvpResult.setData(streamInfo); |
| | | msg.setData(wvpResult); |
| | | resultHolder.invokeAllResult(msg); |
| | | return playResult; |
| | | }else { |
| | | WVPResult wvpResult = new WVPResult(); |
| | | wvpResult.setCode(ErrorCode.SUCCESS.getCode()); |
| | | wvpResult.setMsg(ErrorCode.SUCCESS.getMsg()); |
| | | wvpResult.setData(streamInfo); |
| | | msg.setData(wvpResult); |
| | | |
| | | resultHolder.invokeAllResult(msg); |
| | | if (hookEvent != null) { |
| | | hookEvent.response(mediaServerItem, JSONObject.parseObject(JSON.toJSONString(streamInfo))); |
| | | resultHolder.invokeAllResult(msg); |
| | | if (hookEvent != null) { |
| | | hookEvent.response(mediaServerItem, JSONObject.parseObject(JSON.toJSONString(streamInfo))); |
| | | } |
| | | } |
| | | |
| | | }else { |
| | | redisCatchStorage.stopPlay(streamInfo); |
| | | storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId()); |
| | |
| | | } |
| | | logger.info("[ç¹ææ¶æ¯] æ¶å°invite 200, åç°ä¸çº§èªå®ä¹äºssrc: {}", ssrcInResponse ); |
| | | if (!mediaServerItem.isRtpEnable() || device.isSsrcCheck()) { |
| | | logger.info("[SIP æ¶æ¯] SSRCä¿®æ£ {}->{}", ssrc, ssrcInResponse); |
| | | logger.info("[ç¹ææ¶æ¯] SSRCä¿®æ£ {}->{}", ssrc, ssrcInResponse); |
| | | |
| | | if (!mediaServerItem.getSsrcConfig().checkSsrc(ssrcInResponse)) { |
| | | // ssrc ä¸å¯ç¨ |
| | |
| | | resultHolder.exist(DeferredResultHolder.CALLBACK_CMD_PLAYBACK + deviceId + channelId, uuid); |
| | | }, userSetting.getPlayTimeout()); |
| | | |
| | | SipSubscribe.Event errorEvent = event -> { |
| | | dynamicTask.stop(playBackTimeOutTaskKey); |
| | | requestMessage.setData(WVPResult.fail(ErrorCode.ERROR100.getCode(), String.format("åæ¾å¤±è´¥ï¼ é误ç ï¼ %s, %s", event.statusCode, event.msg))); |
| | | playBackResult.setCode(ErrorCode.ERROR100.getCode()); |
| | | playBackResult.setMsg(String.format("åæ¾å¤±è´¥ï¼ é误ç ï¼ %s, %s", event.statusCode, event.msg)); |
| | | playBackResult.setData(requestMessage); |
| | | playBackResult.setEvent(event); |
| | | playBackCallback.call(playBackResult); |
| | | streamSession.remove(device.getDeviceId(), channelId, ssrcInfo.getStream()); |
| | | }; |
| | | |
| | | InviteStreamCallback hookEvent = (InviteStreamInfo inviteStreamInfo) -> { |
| | | logger.info("æ¶å°åæ¾è®¢é
æ¶æ¯ï¼ " + inviteStreamInfo.getResponse().toJSONString()); |
| | | dynamicTask.stop(playBackTimeOutTaskKey); |
| | | StreamInfo streamInfo = onPublishHandler(inviteStreamInfo.getMediaServerItem(), inviteStreamInfo.getResponse(), deviceId, channelId); |
| | | if (streamInfo == null) { |
| | | logger.warn("设å¤åæ¾APIè°ç¨å¤±è´¥ï¼"); |
| | | playBackResult.setCode(ErrorCode.ERROR100.getCode()); |
| | | playBackResult.setMsg("设å¤åæ¾APIè°ç¨å¤±è´¥ï¼"); |
| | | playBackCallback.call(playBackResult); |
| | | return; |
| | | } |
| | | redisCatchStorage.startPlayback(streamInfo, inviteStreamInfo.getCallId()); |
| | | WVPResult<StreamInfo> success = WVPResult.success(streamInfo); |
| | | requestMessage.setData(success); |
| | | playBackResult.setCode(ErrorCode.SUCCESS.getCode()); |
| | | playBackResult.setMsg(ErrorCode.SUCCESS.getMsg()); |
| | | playBackResult.setData(requestMessage); |
| | | playBackResult.setMediaServerItem(inviteStreamInfo.getMediaServerItem()); |
| | | playBackResult.setResponse(inviteStreamInfo.getResponse()); |
| | | playBackCallback.call(playBackResult); |
| | | }; |
| | | |
| | | cmder.playbackStreamCmd(mediaServerItem, ssrcInfo, device, channelId, startTime, endTime, infoCallBack, |
| | | (InviteStreamInfo inviteStreamInfo) -> { |
| | | logger.info("æ¶å°è®¢é
æ¶æ¯ï¼ " + inviteStreamInfo.getResponse().toJSONString()); |
| | | dynamicTask.stop(playBackTimeOutTaskKey); |
| | | StreamInfo streamInfo = onPublishHandler(inviteStreamInfo.getMediaServerItem(), inviteStreamInfo.getResponse(), deviceId, channelId); |
| | | if (streamInfo == null) { |
| | | logger.warn("设å¤åæ¾APIè°ç¨å¤±è´¥ï¼"); |
| | | playBackResult.setCode(ErrorCode.ERROR100.getCode()); |
| | | playBackResult.setMsg("设å¤åæ¾APIè°ç¨å¤±è´¥ï¼"); |
| | | playBackCallback.call(playBackResult); |
| | | return; |
| | | hookEvent, eventResult -> { |
| | | if (eventResult.type == SipSubscribe.EventResultType.response) { |
| | | ResponseEvent responseEvent = (ResponseEvent)eventResult.event; |
| | | String contentString = new String(responseEvent.getResponse().getRawContent()); |
| | | // è·åssrc |
| | | int ssrcIndex = contentString.indexOf("y="); |
| | | // æ£æ¥æ¯å¦æyåæ®µ |
| | | if (ssrcIndex >= 0) { |
| | | //ssrcè§å®é¿åº¦ä¸º10åèï¼ä¸åä½ä¸é¿åº¦ä»¥é¿å
åç»è¿æâf=âåæ®µ TODO åç»å¯¹ä¸è§èçé10ä½ssrcå
¼å®¹ |
| | | String ssrcInResponse = contentString.substring(ssrcIndex + 2, ssrcIndex + 12); |
| | | // æ¥è¯¢å°ssrcä¸ä¸è´ä¸å¼å¯äºssrcæ ¡éªåéè¦é对å¤ç |
| | | if (ssrcInfo.getSsrc().equals(ssrcInResponse)) { |
| | | return; |
| | | } |
| | | logger.info("[åæ¾æ¶æ¯] æ¶å°invite 200, åç°ä¸çº§èªå®ä¹äºssrc: {}", ssrcInResponse ); |
| | | if (!mediaServerItem.isRtpEnable() || device.isSsrcCheck()) { |
| | | logger.info("[åæ¾æ¶æ¯] SSRCä¿®æ£ {}->{}", ssrcInfo.getSsrc(), ssrcInResponse); |
| | | |
| | | if (!mediaServerItem.getSsrcConfig().checkSsrc(ssrcInResponse)) { |
| | | // ssrc ä¸å¯ç¨ |
| | | // éæ¾ssrc |
| | | mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcInfo.getSsrc()); |
| | | streamSession.remove(device.getDeviceId(), channelId, ssrcInfo.getStream()); |
| | | eventResult.msg = "ä¸çº§èªå®ä¹äºssrc,使¯æ¤ssrcä¸å¯ç¨"; |
| | | eventResult.statusCode = 400; |
| | | errorEvent.response(eventResult); |
| | | return; |
| | | } |
| | | |
| | | // åç«¯å£æ¨¡å¼streamId乿ååï¼éè¦éæ°è®¾ç½®çå¬ |
| | | if (!mediaServerItem.isRtpEnable()) { |
| | | // æ·»å 订é
|
| | | HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed("rtp", ssrcInfo.getStream(), true, "rtsp", mediaServerItem.getId()); |
| | | subscribe.removeSubscribe(hookSubscribe); |
| | | hookSubscribe.getContent().put("stream", String.format("%08x", Integer.parseInt(ssrcInResponse)).toUpperCase()); |
| | | subscribe.addSubscribe(hookSubscribe, (MediaServerItem mediaServerItemInUse, JSONObject response)->{ |
| | | logger.info("[ZLM HOOK] ssrcä¿®æ£åæ¶å°è®¢é
æ¶æ¯ï¼ " + response.toJSONString()); |
| | | dynamicTask.stop(playBackTimeOutTaskKey); |
| | | // hookååº |
| | | onPublishHandlerForPlay(mediaServerItemInUse, response, device.getDeviceId(), channelId, uuid); |
| | | hookEvent.call(new InviteStreamInfo(mediaServerItem, null, eventResult.callId, "rtp", ssrcInfo.getStream())); |
| | | }); |
| | | } |
| | | // å
³értp server |
| | | mediaServerService.closeRTPServer(device.getDeviceId(), channelId, ssrcInfo.getStream()); |
| | | // éæ°å¼å¯ssrc server |
| | | mediaServerService.openRTPServer(mediaServerItem, ssrcInfo.getStream(), ssrcInResponse, device.isSsrcCheck(), true, ssrcInfo.getPort()); |
| | | } |
| | | } |
| | | } |
| | | redisCatchStorage.startPlayback(streamInfo, inviteStreamInfo.getCallId()); |
| | | WVPResult<StreamInfo> success = WVPResult.success(streamInfo); |
| | | requestMessage.setData(success); |
| | | playBackResult.setCode(ErrorCode.SUCCESS.getCode()); |
| | | playBackResult.setMsg(ErrorCode.SUCCESS.getMsg()); |
| | | playBackResult.setData(requestMessage); |
| | | playBackResult.setMediaServerItem(inviteStreamInfo.getMediaServerItem()); |
| | | playBackResult.setResponse(inviteStreamInfo.getResponse()); |
| | | playBackCallback.call(playBackResult); |
| | | }, event -> { |
| | | dynamicTask.stop(playBackTimeOutTaskKey); |
| | | requestMessage.setData(WVPResult.fail(ErrorCode.ERROR100.getCode(), String.format("åæ¾å¤±è´¥ï¼ é误ç ï¼ %s, %s", event.statusCode, event.msg))); |
| | | playBackResult.setCode(ErrorCode.ERROR100.getCode()); |
| | | playBackResult.setMsg(String.format("åæ¾å¤±è´¥ï¼ é误ç ï¼ %s, %s", event.statusCode, event.msg)); |
| | | playBackResult.setData(requestMessage); |
| | | playBackResult.setEvent(event); |
| | | playBackCallback.call(playBackResult); |
| | | streamSession.remove(device.getDeviceId(), channelId, ssrcInfo.getStream()); |
| | | }); |
| | | |
| | | }, errorEvent); |
| | | return result; |
| | | } |
| | | |
| | |
| | | boolean contains = allAppAndStream.contains(app + stream); |
| | | //ä¸åå¨å°±æ·»å |
| | | if (!contains) { |
| | | streamPushItem.setStatus(false); |
| | | streamPushItem.setStreamType("push"); |
| | | streamPushItem.setCreateTime(DateUtil.getNow()); |
| | | streamPushItem.setMediaServerId(mediaServerService.getDefaultMediaServer().getId()); |
| | |
| | | streamPushItem.setApp(streamPushExcelDto.getApp()); |
| | | streamPushItem.setStream(streamPushExcelDto.getStream()); |
| | | streamPushItem.setGbId(streamPushExcelDto.getGbId()); |
| | | streamPushItem.setStatus(false); |
| | | streamPushItem.setStatus(streamPushExcelDto.getStatus()); |
| | | streamPushItem.setStreamType("push"); |
| | | streamPushItem.setCreateTime(DateUtil.getNow()); |
| | | streamPushItem.setMediaServerId(defaultMediaServerId); |
| | |
| | | void sendStreamPushRequestedMsgForStatus(); |
| | | |
| | | List<SendRtpItem> querySendRTPServerByChnnelId(String channelId); |
| | | |
| | | List<SendRtpItem> querySendRTPServerByStream(String stream); |
| | | } |
| | |
| | | @Update(value = {"UPDATE device_channel SET status=0 WHERE deviceId=#{deviceId}"}) |
| | | void offlineByDeviceId(String deviceId); |
| | | |
| | | @Update(value = {"UPDATE device_channel SET status=1 WHERE deviceId=#{deviceId} AND channelId=#{channelId}"}) |
| | | void online(String deviceId, String channelId); |
| | | |
| | | @Insert("<script> " + |
| | | "insert into device_channel " + |
| | | "(channelId, deviceId, name, manufacture, model, owner, civilCode, block, subCount, " + |
| | | " address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " + |
| | | " ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " + |
| | | " longitudeWgs84, latitudeWgs84, createTime, updateTime, businessGroupId, gpsTime) " + |
| | | " longitudeWgs84, latitudeWgs84, hasAudio, createTime, updateTime, businessGroupId, gpsTime) " + |
| | | "values " + |
| | | "<foreach collection='addChannels' index='index' item='item' separator=','> " + |
| | | "('${item.channelId}', '${item.deviceId}', '${item.name}', '${item.manufacture}', '${item.model}', " + |
| | |
| | | "'${item.certNum}', ${item.certifiable}, ${item.errCode}, '${item.secrecy}', " + |
| | | "'${item.ipAddress}', ${item.port}, '${item.password}', ${item.PTZType}, ${item.status}, " + |
| | | "'${item.streamId}', ${item.longitude}, ${item.latitude},${item.longitudeGcj02}, " + |
| | | "${item.latitudeGcj02},${item.longitudeWgs84}, ${item.latitudeWgs84},'${item.createTime}', '${item.updateTime}', " + |
| | | "${item.latitudeGcj02},${item.longitudeWgs84}, ${item.latitudeWgs84}, ${item.hasAudio},'${item.createTime}', '${item.updateTime}', " + |
| | | "'${item.businessGroupId}', '${item.gpsTime}') " + |
| | | "</foreach> " + |
| | | "ON DUPLICATE KEY UPDATE " + |
| | |
| | | "latitudeGcj02=VALUES(latitudeGcj02), " + |
| | | "longitudeWgs84=VALUES(longitudeWgs84), " + |
| | | "latitudeWgs84=VALUES(latitudeWgs84), " + |
| | | "hasAudio=VALUES(hasAudio), " + |
| | | "businessGroupId=VALUES(businessGroupId), " + |
| | | "gpsTime=VALUES(gpsTime)" + |
| | | "</script>") |
| | | int batchAdd(List<DeviceChannel> addChannels); |
| | | |
| | | @Update(value = {"UPDATE device_channel SET status=1 WHERE deviceId=#{deviceId} AND channelId=#{channelId}"}) |
| | | void online(String deviceId, String channelId); |
| | | |
| | | @Update({"<script>" + |
| | | "<foreach collection='updateChannels' item='item' separator=';'>" + |
| | |
| | | " left join platform_catalog pc on pgc.catalogId = pc.id and pgc.platformId = pc.platformId" + |
| | | " where pgc.platformId=#{serverGBId}") |
| | | List<DeviceChannel> queryChannelWithCatalog(String serverGBId); |
| | | |
| | | @Select("select * from device_channel where deviceId = #{deviceId}") |
| | | List<DeviceChannel> queryAllChannels(String deviceId); |
| | | } |
| | |
| | | |
| | | @Insert("<script> " + |
| | | "INSERT into platform_gb_stream " + |
| | | "(gbStreamId, platformId, catalogId) " + |
| | | "(gbStreamId, platformId, catalogId,status) " + |
| | | "values " + |
| | | "<foreach collection='streamPushItems' index='index' item='item' separator=','> " + |
| | | "(${item.gbStreamId}, '${item.platformId}', '${item.catalogId}')" + |
| | | "(${item.gbStreamId}, '${item.platformId}', '${item.catalogId}'), '${item.status}')" + |
| | | "</foreach> " + |
| | | "</script>") |
| | | int batchAdd(List<StreamPushItem> streamPushItems); |
| | |
| | | "1=1 " + |
| | | " <if test='query != null'> AND (st.app LIKE '%${query}%' OR st.stream LIKE '%${query}%' OR gs.gbId LIKE '%${query}%' OR gs.name LIKE '%${query}%')</if> " + |
| | | " <if test='pushing == true' > AND (gs.gbId is null OR st.pushIng=1)</if>" + |
| | | " <if test='pushing == false' > AND st.pushIng=0</if>" + |
| | | " <if test='pushing == false' > AND (gs.pushIng is null OR st.pushIng=0) </if>" + |
| | | " <if test='mediaServerId != null' > AND st.mediaServerId=#{mediaServerId} </if>" + |
| | | "order by st.createTime desc" + |
| | | " </script>"}) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<SendRtpItem> querySendRTPServerByStream(String stream) { |
| | | if (stream == null) { |
| | | return null; |
| | | } |
| | | String platformGbId = "*"; |
| | | String callId = "*"; |
| | | String channelId = "*"; |
| | | String key = VideoManagerConstants.PLATFORM_SEND_RTP_INFO_PREFIX + userSetting.getServerId() + "_" + platformGbId |
| | | + "_" + channelId + "_" + stream + "_" + callId; |
| | | List<Object> scan = RedisUtil.scan(key); |
| | | List<SendRtpItem> result = new ArrayList<>(); |
| | | for (Object o : scan) { |
| | | result.add((SendRtpItem) RedisUtil.get((String) o)); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public List<SendRtpItem> querySendRTPServer(String platformGbId) { |
| | | if (platformGbId == null) { |
| | | platformGbId = "*"; |
| | |
| | | if (CollectionUtils.isEmpty(deviceChannelList)) { |
| | | return false; |
| | | } |
| | | List<DeviceChannel> allChannelInPlay = deviceChannelMapper.getAllChannelInPlay(); |
| | | Map<String,DeviceChannel> allChannelMapInPlay = new ConcurrentHashMap<>(); |
| | | if (allChannelInPlay.size() > 0) { |
| | | for (DeviceChannel deviceChannel : allChannelInPlay) { |
| | | allChannelMapInPlay.put(deviceChannel.getChannelId(), deviceChannel); |
| | | List<DeviceChannel> allChannels = deviceChannelMapper.queryAllChannels(deviceId); |
| | | Map<String,DeviceChannel> allChannelMap = new ConcurrentHashMap<>(); |
| | | if (allChannels.size() > 0) { |
| | | for (DeviceChannel deviceChannel : allChannels) { |
| | | allChannelMap.put(deviceChannel.getChannelId(), deviceChannel); |
| | | } |
| | | } |
| | | TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); |
| | |
| | | List<DeviceChannel> channels = new ArrayList<>(); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | Map<String, Integer> subContMap = new HashMap<>(); |
| | | if (deviceChannelList.size() > 1) { |
| | | if (deviceChannelList.size() > 0) { |
| | | // æ°æ®å»é |
| | | Set<String> gbIdSet = new HashSet<>(); |
| | | for (DeviceChannel deviceChannel : deviceChannelList) { |
| | | if (!gbIdSet.contains(deviceChannel.getChannelId())) { |
| | | gbIdSet.add(deviceChannel.getChannelId()); |
| | | if (allChannelMapInPlay.containsKey(deviceChannel.getChannelId())) { |
| | | deviceChannel.setStreamId(allChannelMapInPlay.get(deviceChannel.getChannelId()).getStreamId()); |
| | | if (allChannelMap.containsKey(deviceChannel.getChannelId())) { |
| | | deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId()); |
| | | deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio()); |
| | | } |
| | | |
| | | channels.add(deviceChannel); |
| | | if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) { |
| | | if (subContMap.get(deviceChannel.getParentId()) == null) { |
| | |
| | | } |
| | | } |
| | | |
| | | }else { |
| | | channels = deviceChannelList; |
| | | } |
| | | if (stringBuilder.length() > 0) { |
| | | logger.info("[ç®å½æ¥è¯¢]æ¶å°çæ°æ®åå¨éå¤ï¼ {}" , stringBuilder); |
| | |
| | | @ExcelProperty("ç®å½ID") |
| | | private String catalogId; |
| | | |
| | | @ExcelProperty("å¨çº¿ç¶æ") |
| | | private boolean status; |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | |
| | | public void setCatalogId(String catalogId) { |
| | | this.catalogId = catalogId; |
| | | } |
| | | |
| | | public boolean isStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public boolean getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(boolean status) { |
| | | this.status = status; |
| | | } |
| | | } |
| | |
| | | private IRoleService roleService; |
| | | |
| | | @GetMapping("/login") |
| | | @PostMapping("/login") |
| | | @Operation(summary = "ç»å½") |
| | | @Parameter(name = "username", description = "ç¨æ·å", required = true) |
| | | @Parameter(name = "password", description = "å¯ç ï¼32ä½md5å å¯ï¼", required = true) |
| | |
| | | <appender-ref ref="STDOUT" /> |
| | | </root> |
| | | |
| | | <logger name="wvp" level="debug" additivity="true"> |
| | | <appender-ref ref="RollingFileError"/> |
| | | <appender-ref ref="RollingFile"/> |
| | | </logger> |
| | | |
| | | <logger name="GB28181_SIP" level="debug" additivity="true"> |
| | | <appender-ref ref="RollingFileError"/> |
| | | <appender-ref ref="sipRollingFile"/> |
| | |
| | | }); |
| | | }, |
| | | chooseChannel: function(platform) { |
| | | this.$refs.chooseChannelDialog.openDialog(platform.serverGBId, platform.name, platform.catalogId, platform.treeType, this.initData) |
| | | console.log("platform.name: " + platform.name) |
| | | this.$refs.chooseChannelDialog.openDialog(platform.serverGBId,platform.deviceGBId, platform.name, platform.catalogId, platform.treeType, this.initData) |
| | | }, |
| | | initData: function() { |
| | | this.getPlatformList(); |
| | |
| | | <el-tab-pane label="ç®å½ç»æ" name="catalog"> |
| | | <el-container> |
| | | <el-main v-bind:style="{backgroundColor: '#FFF', maxHeight: winHeight + 'px'}"> |
| | | <chooseChannelForCatalog ref="chooseChannelForCatalog" :platformId=platformId :platformName=platformName :defaultCatalogId=defaultCatalogId :catalogIdChange="catalogIdChange" :treeType=treeType ></chooseChannelForCatalog> |
| | | <chooseChannelForCatalog ref="chooseChannelForCatalog" :platformId=platformId :platformDeviceId=platformDeviceId :platformName=platformName :defaultCatalogId=defaultCatalogId :catalogIdChange="catalogIdChange" :treeType=treeType ></chooseChannelForCatalog> |
| | | </el-main> |
| | | </el-container> |
| | | </el-tab-pane> |
| | |
| | | tabActiveName: "gbChannel", |
| | | catalogTabActiveName: "catalog", |
| | | platformId: "", |
| | | platformDeviceId: "", |
| | | catalogId: "", |
| | | catalogName: "", |
| | | currentCatalogId: "", |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | openDialog(platformId, platformName, defaultCatalogId, treeType, closeCallback) { |
| | | openDialog(platformId, platformDeviceId, platformName, defaultCatalogId, treeType, closeCallback) { |
| | | console.log("defaultCatalogId: " + defaultCatalogId) |
| | | this.platformId = platformId |
| | | this.platformDeviceId = platformDeviceId |
| | | this.platformName = platformName |
| | | this.defaultCatalogId = defaultCatalogId |
| | | this.showDialog = true |
| | |
| | | import catalogEdit from './catalogEdit.vue' |
| | | export default { |
| | | name: 'chooseChannelForCatalog', |
| | | props: ['platformId', 'platformName', 'defaultCatalogId', 'catalogIdChange', 'treeType'], |
| | | props: ['platformId', 'platformDeviceId', 'platformName', 'defaultCatalogId', 'catalogIdChange', 'treeType'], |
| | | created() { |
| | | this.chooseId = this.defaultCatalogId; |
| | | this.defaultCatalogIdSign = this.defaultCatalogId; |
| | |
| | | }); |
| | | }, |
| | | loadNode: function(node, resolve){ |
| | | console.log("this.platformDeviceIdï¼ " + this.platformDeviceId) |
| | | if (node.level === 0) { |
| | | resolve([ |
| | | { |
| | |
| | | type: -1 |
| | | },{ |
| | | name: this.platformName, |
| | | id: this.platformId, |
| | | id: this.platformDeviceId, |
| | | type: 0 |
| | | } |
| | | ]); |
| | |
| | | return false; |
| | | }, |
| | | nodeClickHandler: function (data, node, tree){ |
| | | console.log(data) |
| | | console.log(node) |
| | | this.chooseId = data.id; |
| | | this.chooseName = data.name; |
| | | if (this.catalogIdChange)this.catalogIdChange(this.chooseId, this.chooseName); |
| | |
| | | }, |
| | | methods: { |
| | | openDialog(catalogIdResult) { |
| | | console.log(this.chooseId) |
| | | this.showDialog = true |
| | | this.catalogIdResult = catalogIdResult |
| | | }, |
| | |
| | | |
| | | }, |
| | | loadNode: function(node, resolve){ |
| | | |
| | | |
| | | |
| | | if (node.level === 0) { |
| | | this.$axios({ |
| | | method:"get", |
| | |
| | | resolve([ |
| | | { |
| | | name: this.platformName, |
| | | id: this.platformId, |
| | | id: res.data.data.deviceGBId, |
| | | type: 0 |
| | | } |
| | | ]); |
| | |
| | | this.chooseId = data.id; |
| | | }, |
| | | close: function() { |
| | | this.chooseId = null; |
| | | this.showDialog = false; |
| | | }, |
| | | submit: function() { |
| | | console.log(this.chooseId) |
| | | if (this.chooseId === null) { |
| | | this.$message({ |
| | | showClose: true, |
| | | message: 'æªéæ©ä»»ä½èç¹,', |
| | | type: 'warning' |
| | | }); |
| | | return; |
| | | } |
| | | if (this.catalogIdResult)this.catalogIdResult(this.chooseId) |
| | | this.showDialog = false; |
| | | }, |
| | |
| | | <el-form-item label="æ¬å°ç«¯å£" prop="devicePort"> |
| | | <el-input v-model="platform.devicePort" :disabled="true" type="number"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="SIP认è¯ç¨æ·å" prop="username"> |
| | | <el-input v-model="platform.username"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form ref="platform2" :rules="rules" :model="platform" label-width="160px"> |
| | | <el-form-item label="SIP认è¯ç¨æ·å" prop="username"> |
| | | <el-input v-model="platform.username"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="è¡æ¿åºå" prop="administrativeDivision"> |
| | | <el-input v-model="platform.administrativeDivision" clearable></el-input> |
| | | </el-form-item> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç®å½ç»æ" prop="treeType" > |
| | | <el-select v-model="platform.treeType" style="width: 100%" > |
| | | <el-select v-model="platform.treeType" style="width: 100%" @change="treeTypeChange"> |
| | | <el-option key="WGS84" label="è¡æ¿åºå" value="CivilCode"></el-option> |
| | | <el-option key="GCJ02" label="ä¸å¡åç»" value="BusinessGroup"></el-option> |
| | | </el-select> |
| | |
| | | <el-checkbox label="å¯ç¨" v-model="platform.enable" @change="checkExpires"></el-checkbox> |
| | | <el-checkbox label="äºå°æ§å¶" v-model="platform.ptz"></el-checkbox> |
| | | <el-checkbox label="æèµ·ç¦»çº¿æ¨æµ" v-model="platform.startOfflinePush"></el-checkbox> |
| | | <el-checkbox label="RTCPä¿æ´»" v-model="platform.rtcp" @change="rtcpCheckBoxChange"></el-checkbox> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="onSubmit">{{ |
| | |
| | | |
| | | }, |
| | | onSubmit: function () { |
| | | if (this.onSubmit_text === "ä¿å") { |
| | | this.$confirm("ä¿®æ¹ç®å½ç»æä¼å¯¼è´å
³èç®å½ä¸ééæ°æ®è¢«æ¸
空", 'æç¤º', { |
| | | dangerouslyUseHTMLString: true, |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | center: true, |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.saveForm() |
| | | }).catch(() => { |
| | | |
| | | }); |
| | | }else { |
| | | this.saveForm() |
| | | } |
| | | this.saveForm() |
| | | }, |
| | | saveForm: function (){ |
| | | this.$axios({ |
| | |
| | | if (this.platform.enable && this.platform.expires == "0") { |
| | | this.platform.expires = "300"; |
| | | } |
| | | }, |
| | | rtcpCheckBoxChange: function (result){ |
| | | if (result) { |
| | | this.$message({ |
| | | showClose: true, |
| | | message: "å¼å¯RTCPä¿æ´»éè¦ä¸çº§å¹³å°æ¯æï¼å¯ä»¥é¿å
æ ææ¨æµ", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }, |
| | | treeTypeChange: function (){ |
| | | this.$message({ |
| | | showClose: true, |
| | | message: "ä¿®æ¹ç®å½ç»æä¼å¯¼è´å
³èç®å½ä¸ééæ°æ®è¢«æ¸
空ï¼ä¿ååçæ", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }, |
| | | }; |