Commit 9f680a2e9e8560cf5f38acdc30335e51d88b2001
1 parent
93806419
修复bug以及日志按照,错误/sip/数据库 分割
Showing
25 changed files
with
187 additions
and
113 deletions
src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
| ... | ... | @@ -31,6 +31,8 @@ public class StreamInfo { |
| 31 | 31 | private String rtsp; |
| 32 | 32 | private String rtsps; |
| 33 | 33 | private String rtc; |
| 34 | + | |
| 35 | + private String rtcs; | |
| 34 | 36 | private String mediaServerId; |
| 35 | 37 | private Object tracks; |
| 36 | 38 | private String startTime; |
| ... | ... | @@ -302,4 +304,12 @@ public class StreamInfo { |
| 302 | 304 | public void setIp(String ip) { |
| 303 | 305 | this.ip = ip; |
| 304 | 306 | } |
| 307 | + | |
| 308 | + public String getRtcs() { | |
| 309 | + return rtcs; | |
| 310 | + } | |
| 311 | + | |
| 312 | + public void setRtcs(String rtcs) { | |
| 313 | + this.rtcs = rtcs; | |
| 314 | + } | |
| 305 | 315 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java
| 1 | 1 | package com.genersoft.iot.vmp.conf.security; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | +import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | |
| 5 | +import org.apache.poi.hssf.eventmodel.ERFListener; | |
| 4 | 6 | import org.slf4j.Logger; |
| 5 | 7 | import org.slf4j.LoggerFactory; |
| 6 | 8 | import org.springframework.security.core.AuthenticationException; |
| ... | ... | @@ -28,8 +30,8 @@ public class AnonymousAuthenticationEntryPoint implements AuthenticationEntryPoi |
| 28 | 30 | response.setHeader("Access-Control-Allow-Headers", "token, Accept, Origin, X-Requested-With, Content-Type, Last-Modified"); |
| 29 | 31 | response.setHeader("Content-type", "application/json;charset=UTF-8"); |
| 30 | 32 | JSONObject jsonObject = new JSONObject(); |
| 31 | - jsonObject.put("code", "-1"); | |
| 32 | - jsonObject.put("msg", "请登录后重新请求"); | |
| 33 | + jsonObject.put("code", ErrorCode.ERROR401.getCode()); | |
| 34 | + jsonObject.put("msg", ErrorCode.ERROR401.getMsg()); | |
| 33 | 35 | String logUri = "api/user/login"; |
| 34 | 36 | if (request.getRequestURI().contains(logUri)){ |
| 35 | 37 | jsonObject.put("msg", e.getMessage()); | ... | ... |
src/main/java/com/genersoft/iot/vmp/conf/security/UrlTokenHandler.java
0 → 100644
| 1 | +package com.genersoft.iot.vmp.conf.security; | |
| 2 | + | |
| 3 | +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; | |
| 4 | + | |
| 5 | +import javax.servlet.ServletContext; | |
| 6 | +import javax.servlet.ServletException; | |
| 7 | +import javax.servlet.SessionCookieConfig; | |
| 8 | +import javax.servlet.SessionTrackingMode; | |
| 9 | +import java.util.Collections; | |
| 10 | + | |
| 11 | +public class UrlTokenHandler extends SpringBootServletInitializer { | |
| 12 | + | |
| 13 | + @Override | |
| 14 | + public void onStartup(ServletContext servletContext) throws ServletException { | |
| 15 | + super.onStartup(servletContext); | |
| 16 | + | |
| 17 | + servletContext.setSessionTrackingModes( | |
| 18 | + Collections.singleton(SessionTrackingMode.COOKIE) | |
| 19 | + ); | |
| 20 | + SessionCookieConfig sessionCookieConfig = servletContext.getSessionCookieConfig(); | |
| 21 | + sessionCookieConfig.setHttpOnly(true); | |
| 22 | + | |
| 23 | + } | |
| 24 | +} | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java
| ... | ... | @@ -2,8 +2,10 @@ package com.genersoft.iot.vmp.gb28181; |
| 2 | 2 | |
| 3 | 3 | import com.genersoft.iot.vmp.conf.SipConfig; |
| 4 | 4 | import com.genersoft.iot.vmp.gb28181.transmit.ISIPProcessorObserver; |
| 5 | +import com.genersoft.iot.vmp.utils.DateUtil; | |
| 5 | 6 | import gov.nist.javax.sip.SipProviderImpl; |
| 6 | 7 | import gov.nist.javax.sip.SipStackImpl; |
| 8 | +import org.apache.commons.lang3.time.DateFormatUtils; | |
| 7 | 9 | import org.slf4j.Logger; |
| 8 | 10 | import org.slf4j.LoggerFactory; |
| 9 | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -13,6 +15,7 @@ import org.springframework.context.annotation.DependsOn; |
| 13 | 15 | import org.springframework.stereotype.Component; |
| 14 | 16 | |
| 15 | 17 | import javax.sip.*; |
| 18 | +import java.text.DateFormat; | |
| 16 | 19 | import java.util.Properties; |
| 17 | 20 | import java.util.TooManyListenersException; |
| 18 | 21 | import java.util.concurrent.LinkedBlockingQueue; |
| ... | ... | @@ -52,7 +55,9 @@ public class SipLayer{ |
| 52 | 55 | * 完整配置参考 gov.nist.javax.sip.SipStackImpl,需要下载源码 |
| 53 | 56 | * gov/nist/javax/sip/SipStackImpl.class |
| 54 | 57 | */ |
| 55 | - properties.setProperty("gov.nist.javax.sip.LOG_MESSAGE_CONTENT", "true"); | |
| 58 | + if (logger.isDebugEnabled()) { | |
| 59 | + properties.setProperty("gov.nist.javax.sip.LOG_MESSAGE_CONTENT", "true"); | |
| 60 | + } | |
| 56 | 61 | // 接收所有notify请求,即使没有订阅 |
| 57 | 62 | properties.setProperty("gov.nist.javax.sip.DELIVER_UNSOLICITED_NOTIFY", "true"); |
| 58 | 63 | // 为_NULL _对话框传递_终止的_事件 |
| ... | ... | @@ -67,9 +72,10 @@ public class SipLayer{ |
| 67 | 72 | * 0; public static final int TRACE_MESSAGES = 16; public static final int |
| 68 | 73 | * TRACE_EXCEPTION = 17; public static final int TRACE_DEBUG = 32; |
| 69 | 74 | */ |
| 70 | - properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "0"); | |
| 71 | - properties.setProperty("gov.nist.javax.sip.SERVER_LOG", "sip_server_log"); | |
| 72 | - properties.setProperty("gov.nist.javax.sip.DEBUG_LOG", "sip_debug_log"); | |
| 75 | + if (logger.isDebugEnabled()) { | |
| 76 | + properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "DEBUG"); | |
| 77 | + } | |
| 78 | + properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "INFO"); | |
| 73 | 79 | sipStack = (SipStackImpl) sipFactory.createSipStack(properties); |
| 74 | 80 | |
| 75 | 81 | return sipStack; | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorObserver.java
| ... | ... | @@ -71,7 +71,6 @@ public class SIPProcessorObserver implements ISIPProcessorObserver { |
| 71 | 71 | @Override |
| 72 | 72 | @Async |
| 73 | 73 | public void processRequest(RequestEvent requestEvent) { |
| 74 | - logger.debug("\n收到请求:\n{}", requestEvent.getRequest()); | |
| 75 | 74 | String method = requestEvent.getRequest().getMethod(); |
| 76 | 75 | ISIPRequestProcessor sipRequestProcessor = requestProcessorMap.get(method); |
| 77 | 76 | if (sipRequestProcessor == null) { |
| ... | ... | @@ -90,7 +89,6 @@ public class SIPProcessorObserver implements ISIPProcessorObserver { |
| 90 | 89 | @Async |
| 91 | 90 | public void processResponse(ResponseEvent responseEvent) { |
| 92 | 91 | Response response = responseEvent.getResponse(); |
| 93 | - logger.debug("\n收到响应:\n{}", responseEvent.getResponse()); | |
| 94 | 92 | int status = response.getStatusCode(); |
| 95 | 93 | |
| 96 | 94 | if (((status >= 200) && (status < 300)) || status == Response.UNAUTHORIZED) { // Success! | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
| ... | ... | @@ -640,7 +640,7 @@ public class SIPCommander implements ISIPCommander { |
| 640 | 640 | hookEvent.call(new InviteStreamInfo(mediaServerItem, json, callIdHeader.getCallId(), "rtp", ssrcInfo.getStream())); |
| 641 | 641 | subscribe.removeSubscribe(hookSubscribe); |
| 642 | 642 | hookSubscribe.getContent().put("regist", false); |
| 643 | - hookSubscribe.getContent().put("schema", "rtmp"); | |
| 643 | + hookSubscribe.getContent().put("schema", "rtsp"); | |
| 644 | 644 | // 添加流注销的订阅,注销了后向设备发送bye |
| 645 | 645 | subscribe.addSubscribe(hookSubscribe, |
| 646 | 646 | (MediaServerItem mediaServerItemForEnd, JSONObject jsonForEnd)->{ | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
| ... | ... | @@ -410,6 +410,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements |
| 410 | 410 | streamId = String.format("%s_%s", device.getDeviceId(), channelId); |
| 411 | 411 | } |
| 412 | 412 | SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId, null, device.isSsrcCheck(), false); |
| 413 | + logger.info(JSONObject.toJSONString(ssrcInfo)); | |
| 413 | 414 | sendRtpItem.setStreamId(ssrcInfo.getStream()); |
| 414 | 415 | // 写入redis, 超时时回复 |
| 415 | 416 | redisCatchStorage.updateSendRTPSever(sendRtpItem); | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java
| ... | ... | @@ -180,7 +180,6 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme |
| 180 | 180 | |
| 181 | 181 | private void processNotifyCatalogList(RequestEvent evt, Element rootElement) throws SipException { |
| 182 | 182 | |
| 183 | - System.out.println(evt.getRequest().toString()); | |
| 184 | 183 | String platformId = SipUtils.getUserIdFromFromHeader(evt.getRequest()); |
| 185 | 184 | String deviceId = XmlUtil.getText(rootElement, "DeviceID"); |
| 186 | 185 | ParentPlatform platform = storager.queryParentPlatByServerGBId(platformId); | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java
| ... | ... | @@ -164,7 +164,7 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme |
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - if (channelId.equals(sipConfig.getId())) { | |
| 167 | + if ("7".equals(deviceAlarm.getAlarmMethod()) ) { | |
| 168 | 168 | // 发送给平台的报警信息。 发送redis通知 |
| 169 | 169 | AlarmChannelMessage alarmChannelMessage = new AlarmChannelMessage(); |
| 170 | 170 | alarmChannelMessage.setAlarmSn(Integer.parseInt(deviceAlarm.getAlarmMethod())); | ... | ... |
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
| ... | ... | @@ -7,12 +7,10 @@ import java.util.Map; |
| 7 | 7 | import com.alibaba.fastjson.JSON; |
| 8 | 8 | import com.genersoft.iot.vmp.common.StreamInfo; |
| 9 | 9 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 10 | -import com.genersoft.iot.vmp.gb28181.bean.Device; | |
| 11 | -import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; | |
| 12 | -import com.genersoft.iot.vmp.gb28181.bean.GbStream; | |
| 13 | -import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction; | |
| 10 | +import com.genersoft.iot.vmp.gb28181.bean.*; | |
| 14 | 11 | import com.genersoft.iot.vmp.gb28181.event.EventPublisher; |
| 15 | 12 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| 13 | +import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; | |
| 16 | 14 | import com.genersoft.iot.vmp.media.zlm.dto.*; |
| 17 | 15 | import com.genersoft.iot.vmp.service.*; |
| 18 | 16 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| ... | ... | @@ -50,6 +48,9 @@ public class ZLMHttpHookListener { |
| 50 | 48 | private SIPCommander cmder; |
| 51 | 49 | |
| 52 | 50 | @Autowired |
| 51 | + private SIPCommanderFroPlatform commanderFroPlatform; | |
| 52 | + | |
| 53 | + @Autowired | |
| 53 | 54 | private IPlayService playService; |
| 54 | 55 | |
| 55 | 56 | @Autowired |
| ... | ... | @@ -237,7 +238,7 @@ public class ZLMHttpHookListener { |
| 237 | 238 | // 鉴权通过 |
| 238 | 239 | redisCatchStorage.updateStreamAuthorityInfo(param.getApp(), param.getStream(), streamAuthorityInfo); |
| 239 | 240 | // 通知assist新的callId |
| 240 | - if (mediaInfo != null) { | |
| 241 | + if (mediaInfo != null && mediaInfo.getRecordAssistPort() > 0) { | |
| 241 | 242 | assistRESTfulUtils.addStreamCallInfo(mediaInfo, param.getApp(), param.getStream(), callId, null); |
| 242 | 243 | } |
| 243 | 244 | }else { |
| ... | ... | @@ -427,7 +428,7 @@ public class ZLMHttpHookListener { |
| 427 | 428 | }else { |
| 428 | 429 | redisCatchStorage.removeStreamAuthorityInfo(app, stream); |
| 429 | 430 | } |
| 430 | - if ("rtmp".equals(schema)){ | |
| 431 | + if ("rtsp".equals(schema)){ | |
| 431 | 432 | logger.info("on_stream_changed:注册->{}, app->{}, stream->{}", regist, app, stream); |
| 432 | 433 | if (regist) { |
| 433 | 434 | mediaServerService.addCount(mediaServerId); |
| ... | ... | @@ -523,17 +524,21 @@ public class ZLMHttpHookListener { |
| 523 | 524 | if ("rtp".equals(app)){ |
| 524 | 525 | ret.put("close", true); |
| 525 | 526 | StreamInfo streamInfoForPlayCatch = redisCatchStorage.queryPlayByStreamId(streamId); |
| 526 | - SsrcTransaction ssrcTransaction = sessionManager.getSsrcTransaction(null, null, null, streamId); | |
| 527 | 527 | if (streamInfoForPlayCatch != null) { |
| 528 | - // 如果在给上级推流,也不停止。 | |
| 528 | + // 收到无人观看说明流也没有在往上级推送 | |
| 529 | 529 | if (redisCatchStorage.isChannelSendingRTP(streamInfoForPlayCatch.getChannelId())) { |
| 530 | - ret.put("close", false); | |
| 531 | - } else { | |
| 532 | - cmder.streamByeCmd(streamInfoForPlayCatch.getDeviceID(), streamInfoForPlayCatch.getChannelId(), | |
| 533 | - streamInfoForPlayCatch.getStream(), null); | |
| 534 | - redisCatchStorage.stopPlay(streamInfoForPlayCatch); | |
| 535 | - storager.stopPlay(streamInfoForPlayCatch.getDeviceID(), streamInfoForPlayCatch.getChannelId()); | |
| 530 | + List<SendRtpItem> sendRtpItems = redisCatchStorage.querySendRTPServerByChnnelId(streamInfoForPlayCatch.getChannelId()); | |
| 531 | + if (sendRtpItems.size() > 0) { | |
| 532 | + for (SendRtpItem sendRtpItem : sendRtpItems) { | |
| 533 | + ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId()); | |
| 534 | + commanderFroPlatform.streamByeCmd(parentPlatform, sendRtpItem.getCallId()); | |
| 535 | + } | |
| 536 | + } | |
| 536 | 537 | } |
| 538 | + cmder.streamByeCmd(streamInfoForPlayCatch.getDeviceID(), streamInfoForPlayCatch.getChannelId(), | |
| 539 | + streamInfoForPlayCatch.getStream(), null); | |
| 540 | + redisCatchStorage.stopPlay(streamInfoForPlayCatch); | |
| 541 | + storager.stopPlay(streamInfoForPlayCatch.getDeviceID(), streamInfoForPlayCatch.getChannelId()); | |
| 537 | 542 | }else{ |
| 538 | 543 | StreamInfo streamInfoForPlayBackCatch = redisCatchStorage.queryPlayback(null, null, streamId, null); |
| 539 | 544 | if (streamInfoForPlayBackCatch != null) { | ... | ... |
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
| ... | ... | @@ -92,6 +92,7 @@ public class ZLMRTPServerFactory { |
| 92 | 92 | int result = -1; |
| 93 | 93 | // 查询此rtp server 是否已经存在 |
| 94 | 94 | JSONObject rtpInfo = zlmresTfulUtils.getRtpInfo(mediaServerItem, streamId); |
| 95 | + logger.info(JSONObject.toJSONString(rtpInfo)); | |
| 95 | 96 | if(rtpInfo.getInteger("code") == 0){ |
| 96 | 97 | if (rtpInfo.getBoolean("exist")) { |
| 97 | 98 | result = rtpInfo.getInteger("local_port"); |
| ... | ... | @@ -113,7 +114,7 @@ public class ZLMRTPServerFactory { |
| 113 | 114 | } |
| 114 | 115 | param.put("ssrc", ssrc); |
| 115 | 116 | JSONObject openRtpServerResultJson = zlmresTfulUtils.openRtpServer(mediaServerItem, param); |
| 116 | - | |
| 117 | + logger.info(JSONObject.toJSONString(openRtpServerResultJson)); | |
| 117 | 118 | if (openRtpServerResultJson != null) { |
| 118 | 119 | if (openRtpServerResultJson.getInteger("code") == 0) { |
| 119 | 120 | result= openRtpServerResultJson.getInteger("port"); |
| ... | ... | @@ -270,7 +271,7 @@ public class ZLMRTPServerFactory { |
| 270 | 271 | * 查询待转推的流是否就绪 |
| 271 | 272 | */ |
| 272 | 273 | public Boolean isRtpReady(MediaServerItem mediaServerItem, String streamId) { |
| 273 | - JSONObject mediaInfo = zlmresTfulUtils.getMediaInfo(mediaServerItem,"rtp", "rtmp", streamId); | |
| 274 | + JSONObject mediaInfo = zlmresTfulUtils.getMediaInfo(mediaServerItem,"rtp", "rtsp", streamId); | |
| 274 | 275 | return (mediaInfo.getInteger("code") == 0 && mediaInfo.getBoolean("online")); |
| 275 | 276 | } |
| 276 | 277 | |
| ... | ... | @@ -290,7 +291,7 @@ public class ZLMRTPServerFactory { |
| 290 | 291 | * @return |
| 291 | 292 | */ |
| 292 | 293 | public int totalReaderCount(MediaServerItem mediaServerItem, String app, String streamId) { |
| 293 | - JSONObject mediaInfo = zlmresTfulUtils.getMediaInfo(mediaServerItem, app, "rtmp", streamId); | |
| 294 | + JSONObject mediaInfo = zlmresTfulUtils.getMediaInfo(mediaServerItem, app, "rtsp", streamId); | |
| 294 | 295 | if (mediaInfo == null) { |
| 295 | 296 | return 0; |
| 296 | 297 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
| ... | ... | @@ -417,7 +417,7 @@ public class MediaServerServiceImpl implements IMediaServerService { |
| 417 | 417 | if (RedisUtil.zScore(key, serverItem.getId()) == null) { // 不存在则设置默认值 已存在则重置 |
| 418 | 418 | RedisUtil.zAdd(key, serverItem.getId(), 0L); |
| 419 | 419 | // 查询服务流数量 |
| 420 | - zlmresTfulUtils.getMediaList(serverItem, null, null, "rtmp",(mediaList ->{ | |
| 420 | + zlmresTfulUtils.getMediaList(serverItem, null, null, "rtsp",(mediaList ->{ | |
| 421 | 421 | Integer code = mediaList.getInteger("code"); |
| 422 | 422 | if (code == 0) { |
| 423 | 423 | JSONArray data = mediaList.getJSONArray("data"); | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java
| ... | ... | @@ -112,6 +112,7 @@ public class MediaServiceImpl implements IMediaService { |
| 112 | 112 | streamInfoResult.setWs_fmp4(String.format("ws://%s:%s/%s/%s.live.mp4%s", addr, mediaInfo.getHttpPort(), app, stream, callIdParam)); |
| 113 | 113 | streamInfoResult.setTs(String.format("http://%s:%s/%s/%s.live.ts%s", addr, mediaInfo.getHttpPort(), app, stream, callIdParam)); |
| 114 | 114 | streamInfoResult.setWs_ts(String.format("ws://%s:%s/%s/%s.live.ts%s", addr, mediaInfo.getHttpPort(), app, stream, callIdParam)); |
| 115 | + streamInfoResult.setRtc(String.format("http://%s:%s/index/api/webrtc?app=%s&stream=%s&type=play%s", mediaInfo.getStreamIp(), mediaInfo.getHttpPort(), app, stream, ObjectUtils.isEmpty(callId)?"":"&callId=" + callId)); | |
| 115 | 116 | if (mediaInfo.getHttpSSlPort() != 0) { |
| 116 | 117 | streamInfoResult.setHttps_flv(String.format("https://%s:%s/%s/%s.live.flv%s", addr, mediaInfo.getHttpSSlPort(), app, stream, callIdParam)); |
| 117 | 118 | streamInfoResult.setWss_flv(String.format("wss://%s:%s/%s/%s.live.flv%s", addr, mediaInfo.getHttpSSlPort(), app, stream, callIdParam)); |
| ... | ... | @@ -122,7 +123,7 @@ public class MediaServiceImpl implements IMediaService { |
| 122 | 123 | streamInfoResult.setHttps_ts(String.format("https://%s:%s/%s/%s.live.ts%s", addr, mediaInfo.getHttpSSlPort(), app, stream, callIdParam)); |
| 123 | 124 | streamInfoResult.setWss_ts(String.format("wss://%s:%s/%s/%s.live.ts%s", addr, mediaInfo.getHttpSSlPort(), app, stream, callIdParam)); |
| 124 | 125 | streamInfoResult.setWss_ts(String.format("wss://%s:%s/%s/%s.live.ts%s", addr, mediaInfo.getHttpSSlPort(), app, stream, callIdParam)); |
| 125 | - streamInfoResult.setRtc(String.format("https://%s:%s/index/api/webrtc?app=%s&stream=%s&type=play%s", mediaInfo.getStreamIp(), mediaInfo.getHttpSSlPort(), app, stream, ObjectUtils.isEmpty(callId)?"":"&callId=" + callId)); | |
| 126 | + streamInfoResult.setRtcs(String.format("https://%s:%s/index/api/webrtc?app=%s&stream=%s&type=play%s", mediaInfo.getStreamIp(), mediaInfo.getHttpSSlPort(), app, stream, ObjectUtils.isEmpty(callId)?"":"&callId=" + callId)); | |
| 126 | 127 | } |
| 127 | 128 | |
| 128 | 129 | streamInfoResult.setTracks(tracks); | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
| ... | ... | @@ -195,6 +195,7 @@ public class PlayServiceImpl implements IPlayService { |
| 195 | 195 | streamId = String.format("%s_%s", device.getDeviceId(), channelId); |
| 196 | 196 | } |
| 197 | 197 | SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId, device.isSsrcCheck(), false); |
| 198 | + logger.info(JSONObject.toJSONString(ssrcInfo)); | |
| 198 | 199 | play(mediaServerItem, ssrcInfo, device, channelId, (mediaServerItemInUse, response)->{ |
| 199 | 200 | if (hookEvent != null) { |
| 200 | 201 | hookEvent.response(mediaServerItem, response); |
| ... | ... | @@ -306,7 +307,7 @@ public class PlayServiceImpl implements IPlayService { |
| 306 | 307 | // 单端口模式streamId也有变化,需要重新设置监听 |
| 307 | 308 | if (!mediaServerItem.isRtpEnable()) { |
| 308 | 309 | // 添加订阅 |
| 309 | - HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed("rtp", stream, true, "rtmp", mediaServerItem.getId()); | |
| 310 | + HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed("rtp", stream, true, "rtsp", mediaServerItem.getId()); | |
| 310 | 311 | subscribe.removeSubscribe(hookSubscribe); |
| 311 | 312 | hookSubscribe.getContent().put("stream", String.format("%08x", Integer.parseInt(ssrcInResponse)).toUpperCase()); |
| 312 | 313 | subscribe.addSubscribe(hookSubscribe, (MediaServerItem mediaServerItemInUse, JSONObject response)->{ | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/RedisAlarmMsgListener.java
| ... | ... | @@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON; |
| 4 | 4 | import com.genersoft.iot.vmp.gb28181.bean.*; |
| 5 | 5 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; |
| 6 | 6 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| 7 | +import com.genersoft.iot.vmp.service.IPlatformChannelService; | |
| 8 | +import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | |
| 7 | 9 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; |
| 8 | 10 | import com.genersoft.iot.vmp.utils.DateUtil; |
| 9 | 11 | import org.slf4j.Logger; |
| ... | ... | @@ -12,6 +14,9 @@ import org.springframework.beans.factory.annotation.Autowired; |
| 12 | 14 | import org.springframework.data.redis.connection.Message; |
| 13 | 15 | import org.springframework.data.redis.connection.MessageListener; |
| 14 | 16 | import org.springframework.stereotype.Component; |
| 17 | +import org.springframework.util.ObjectUtils; | |
| 18 | + | |
| 19 | +import java.util.List; | |
| 15 | 20 | |
| 16 | 21 | |
| 17 | 22 | @Component |
| ... | ... | @@ -37,8 +42,6 @@ public class RedisAlarmMsgListener implements MessageListener { |
| 37 | 42 | return; |
| 38 | 43 | } |
| 39 | 44 | String gbId = alarmChannelMessage.getGbId(); |
| 40 | - Device device = storage.queryVideoDevice(gbId); | |
| 41 | - ParentPlatform platform = storage.queryParentPlatByServerGBId(gbId); | |
| 42 | 45 | |
| 43 | 46 | DeviceAlarm deviceAlarm = new DeviceAlarm(); |
| 44 | 47 | deviceAlarm.setCreateTime(DateUtil.getNow()); |
| ... | ... | @@ -46,18 +49,29 @@ public class RedisAlarmMsgListener implements MessageListener { |
| 46 | 49 | deviceAlarm.setAlarmDescription(alarmChannelMessage.getAlarmDescription()); |
| 47 | 50 | deviceAlarm.setAlarmMethod("" + alarmChannelMessage.getAlarmSn()); |
| 48 | 51 | deviceAlarm.setAlarmPriority("1"); |
| 49 | - deviceAlarm.setAlarmTime(DateUtil.getNow()); | |
| 52 | + deviceAlarm.setAlarmTime(DateUtil.getNowForISO8601()); | |
| 50 | 53 | deviceAlarm.setAlarmType("1"); |
| 51 | 54 | deviceAlarm.setLongitude(0); |
| 52 | 55 | deviceAlarm.setLatitude(0); |
| 53 | 56 | |
| 54 | - | |
| 55 | - if (device != null && platform == null) { | |
| 56 | - commander.sendAlarmMessage(device, deviceAlarm); | |
| 57 | - }else if (device == null && platform != null){ | |
| 58 | - commanderForPlatform.sendAlarmMessage(platform, deviceAlarm); | |
| 57 | + if (ObjectUtils.isEmpty(gbId)) { | |
| 58 | + // 发送给所有的上级 | |
| 59 | + List<ParentPlatform> parentPlatforms = storage.queryEnableParentPlatformList(true); | |
| 60 | + if (parentPlatforms.size() > 0) { | |
| 61 | + for (ParentPlatform parentPlatform : parentPlatforms) { | |
| 62 | + commanderForPlatform.sendAlarmMessage(parentPlatform, deviceAlarm); | |
| 63 | + } | |
| 64 | + } | |
| 59 | 65 | }else { |
| 60 | - logger.warn("无法确定" + gbId + "是平台还是设备"); | |
| 66 | + Device device = storage.queryVideoDevice(gbId); | |
| 67 | + ParentPlatform platform = storage.queryParentPlatByServerGBId(gbId); | |
| 68 | + if (device != null && platform == null) { | |
| 69 | + commander.sendAlarmMessage(device, deviceAlarm); | |
| 70 | + }else if (device == null && platform != null){ | |
| 71 | + commanderForPlatform.sendAlarmMessage(platform, deviceAlarm); | |
| 72 | + }else { | |
| 73 | + logger.warn("无法确定" + gbId + "是平台还是设备"); | |
| 74 | + } | |
| 61 | 75 | } |
| 62 | 76 | } |
| 63 | 77 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/RedisGbPlayMsgListener.java
| ... | ... | @@ -271,7 +271,7 @@ public class RedisGbPlayMsgListener implements MessageListener { |
| 271 | 271 | }, userSetting.getPlatformPlayTimeout()); |
| 272 | 272 | |
| 273 | 273 | // 添加订阅 |
| 274 | - HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed(content.getApp(), content.getStream(), true, "rtmp", mediaServerItem.getId()); | |
| 274 | + HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed(content.getApp(), content.getStream(), true, "rtsp", mediaServerItem.getId()); | |
| 275 | 275 | |
| 276 | 276 | subscribe.addSubscribe(hookSubscribe, (MediaServerItem mediaServerItemInUse, JSONObject json)->{ |
| 277 | 277 | dynamicTask.stop(taskKey); | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java
| ... | ... | @@ -301,7 +301,6 @@ public class StreamProxyServiceImpl implements IStreamProxyService { |
| 301 | 301 | if (jsonObject == null) { |
| 302 | 302 | return false; |
| 303 | 303 | } |
| 304 | - System.out.println(jsonObject); | |
| 305 | 304 | if (jsonObject.getInteger("code") == 0) { |
| 306 | 305 | result = true; |
| 307 | 306 | streamProxy.setEnable(true); |
| ... | ... | @@ -427,7 +426,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService { |
| 427 | 426 | if(data != null && data.size() > 0) { |
| 428 | 427 | for (int i = 0; i < data.size(); i++) { |
| 429 | 428 | JSONObject streamJSONObj = data.getJSONObject(i); |
| 430 | - if ("rtmp".equals(streamJSONObj.getString("schema"))) { | |
| 429 | + if ("rtsp".equals(streamJSONObj.getString("schema"))) { | |
| 431 | 430 | StreamInfo streamInfo = new StreamInfo(); |
| 432 | 431 | String app = streamJSONObj.getString("app"); |
| 433 | 432 | String stream = streamJSONObj.getString("stream"); | ... | ... |
src/main/java/com/genersoft/iot/vmp/storager/IRedisCatchStorage.java
src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
| ... | ... | @@ -380,6 +380,24 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage { |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | @Override |
| 383 | + public List<SendRtpItem> querySendRTPServerByChnnelId(String channelId) { | |
| 384 | + if (channelId == null) { | |
| 385 | + return null; | |
| 386 | + } | |
| 387 | + String platformGbId = "*"; | |
| 388 | + String callId = "*"; | |
| 389 | + String streamId = "*"; | |
| 390 | + String key = VideoManagerConstants.PLATFORM_SEND_RTP_INFO_PREFIX + userSetting.getServerId() + "_" + platformGbId | |
| 391 | + + "_" + channelId + "_" + streamId + "_" + callId; | |
| 392 | + List<Object> scan = RedisUtil.scan(key); | |
| 393 | + List<SendRtpItem> result = new ArrayList<>(); | |
| 394 | + for (Object o : scan) { | |
| 395 | + result.add((SendRtpItem) RedisUtil.get((String) o)); | |
| 396 | + } | |
| 397 | + return result; | |
| 398 | + } | |
| 399 | + | |
| 400 | + @Override | |
| 383 | 401 | public List<SendRtpItem> querySendRTPServer(String platformGbId) { |
| 384 | 402 | if (platformGbId == null) { |
| 385 | 403 | platformGbId = "*"; | ... | ... |
src/main/java/com/genersoft/iot/vmp/utils/DateUtil.java
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
| ... | ... | @@ -197,7 +197,7 @@ public class PlatformController { |
| 197 | 197 | @Operation(summary = "保存上级平台信息") |
| 198 | 198 | @PostMapping("/save") |
| 199 | 199 | @ResponseBody |
| 200 | - public String savePlatform(@RequestBody ParentPlatform parentPlatform) { | |
| 200 | + public void savePlatform(@RequestBody ParentPlatform parentPlatform) { | |
| 201 | 201 | |
| 202 | 202 | if (logger.isDebugEnabled()) { |
| 203 | 203 | logger.debug("保存上级平台信息API调用"); |
| ... | ... | @@ -247,7 +247,6 @@ public class PlatformController { |
| 247 | 247 | // 停止订阅相关的定时任务 |
| 248 | 248 | subscribeHolder.removeAllSubscribe(parentPlatform.getServerGBId()); |
| 249 | 249 | } |
| 250 | - return null; | |
| 251 | 250 | } else { |
| 252 | 251 | throw new ControllerException(ErrorCode.ERROR100.getCode(),"写入数据库失败"); |
| 253 | 252 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java
| ... | ... | @@ -5,6 +5,7 @@ import com.alibaba.excel.ExcelReader; |
| 5 | 5 | import com.alibaba.excel.read.metadata.ReadSheet; |
| 6 | 6 | import com.genersoft.iot.vmp.common.StreamInfo; |
| 7 | 7 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 8 | +import com.genersoft.iot.vmp.conf.exception.ControllerException; | |
| 8 | 9 | import com.genersoft.iot.vmp.conf.security.SecurityUtils; |
| 9 | 10 | import com.genersoft.iot.vmp.conf.security.dto.LoginUser; |
| 10 | 11 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| ... | ... | @@ -17,6 +18,7 @@ import com.genersoft.iot.vmp.service.IMediaService; |
| 17 | 18 | import com.genersoft.iot.vmp.service.IStreamPushService; |
| 18 | 19 | import com.genersoft.iot.vmp.service.impl.StreamPushUploadFileHandler; |
| 19 | 20 | import com.genersoft.iot.vmp.vmanager.bean.BatchGBStreamParam; |
| 21 | +import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | |
| 20 | 22 | import com.genersoft.iot.vmp.vmanager.bean.StreamPushExcelDto; |
| 21 | 23 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| 22 | 24 | import com.github.pagehelper.PageInfo; |
| ... | ... | @@ -95,11 +97,9 @@ public class StreamPushController { |
| 95 | 97 | @PostMapping(value = "/save_to_gb") |
| 96 | 98 | @ResponseBody |
| 97 | 99 | @Operation(summary = "将推流添加到国标") |
| 98 | - public Object saveToGB(@RequestBody GbStream stream){ | |
| 99 | - if (streamPushService.saveToGB(stream)){ | |
| 100 | - return "success"; | |
| 101 | - }else { | |
| 102 | - return "fail"; | |
| 100 | + public void saveToGB(@RequestBody GbStream stream){ | |
| 101 | + if (!streamPushService.saveToGB(stream)){ | |
| 102 | + throw new ControllerException(ErrorCode.ERROR100); | |
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
| ... | ... | @@ -107,11 +107,9 @@ public class StreamPushController { |
| 107 | 107 | @DeleteMapping(value = "/remove_form_gb") |
| 108 | 108 | @ResponseBody |
| 109 | 109 | @Operation(summary = "将推流移出到国标") |
| 110 | - public Object removeFormGB(@RequestBody GbStream stream){ | |
| 111 | - if (streamPushService.removeFromGB(stream)){ | |
| 112 | - return "success"; | |
| 113 | - }else { | |
| 114 | - return "fail"; | |
| 110 | + public void removeFormGB(@RequestBody GbStream stream){ | |
| 111 | + if (!streamPushService.removeFromGB(stream)){ | |
| 112 | + throw new ControllerException(ErrorCode.ERROR100); | |
| 115 | 113 | } |
| 116 | 114 | } |
| 117 | 115 | |
| ... | ... | @@ -121,25 +119,21 @@ public class StreamPushController { |
| 121 | 119 | @Operation(summary = "中止一个推流") |
| 122 | 120 | @Parameter(name = "app", description = "应用名", required = true) |
| 123 | 121 | @Parameter(name = "stream", description = "流id", required = true) |
| 124 | - public Object stop(String app, String streamId){ | |
| 125 | - if (streamPushService.stop(app, streamId)){ | |
| 126 | - return "success"; | |
| 127 | - }else { | |
| 128 | - return "fail"; | |
| 122 | + public void stop(String app, String streamId){ | |
| 123 | + if (!streamPushService.stop(app, streamId)){ | |
| 124 | + throw new ControllerException(ErrorCode.ERROR100); | |
| 129 | 125 | } |
| 130 | 126 | } |
| 131 | 127 | |
| 132 | 128 | @DeleteMapping(value = "/batchStop") |
| 133 | 129 | @ResponseBody |
| 134 | 130 | @Operation(summary = "中止多个推流") |
| 135 | - public Object batchStop(@RequestBody BatchGBStreamParam batchGBStreamParam){ | |
| 131 | + public void batchStop(@RequestBody BatchGBStreamParam batchGBStreamParam){ | |
| 136 | 132 | if (batchGBStreamParam.getGbStreams().size() == 0) { |
| 137 | - return "fail"; | |
| 133 | + throw new ControllerException(ErrorCode.ERROR100); | |
| 138 | 134 | } |
| 139 | - if (streamPushService.batchStop(batchGBStreamParam.getGbStreams())){ | |
| 140 | - return "success"; | |
| 141 | - }else { | |
| 142 | - return "fail"; | |
| 135 | + if (!streamPushService.batchStop(batchGBStreamParam.getGbStreams())){ | |
| 136 | + throw new ControllerException(ErrorCode.ERROR100); | |
| 143 | 137 | } |
| 144 | 138 | } |
| 145 | 139 | |
| ... | ... | @@ -249,7 +243,7 @@ public class StreamPushController { |
| 249 | 243 | @Parameter(name = "app", description = "应用名", required = true) |
| 250 | 244 | @Parameter(name = "stream", description = "流id", required = true) |
| 251 | 245 | @Parameter(name = "mediaServerId", description = "媒体服务器id") |
| 252 | - public WVPResult<StreamInfo> getPlayUrl(@RequestParam String app,@RequestParam String stream, | |
| 246 | + public StreamInfo getPlayUrl(@RequestParam String app,@RequestParam String stream, | |
| 253 | 247 | @RequestParam(required = false) String mediaServerId){ |
| 254 | 248 | boolean authority = false; |
| 255 | 249 | // 是否登陆用户, 登陆用户返回完整信息 |
| ... | ... | @@ -257,52 +251,38 @@ public class StreamPushController { |
| 257 | 251 | if (userInfo!= null) { |
| 258 | 252 | authority = true; |
| 259 | 253 | } |
| 260 | - WVPResult<StreamInfo> result = new WVPResult<>(); | |
| 261 | 254 | StreamPushItem push = streamPushService.getPush(app, stream); |
| 262 | 255 | if (push != null && !push.isSelf()) { |
| 263 | - result.setCode(-1); | |
| 264 | - result.setMsg("来自其他平台的推流信息"); | |
| 265 | - return result; | |
| 256 | + throw new ControllerException(ErrorCode.ERROR100.getCode(), "来自其他平台的推流信息"); | |
| 266 | 257 | } |
| 267 | 258 | StreamInfo streamInfo = mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId, authority); |
| 268 | - if (streamInfo != null){ | |
| 269 | - result.setCode(0); | |
| 270 | - result.setMsg("success"); | |
| 271 | - result.setData(streamInfo); | |
| 272 | - }else { | |
| 273 | - result.setCode(-1); | |
| 274 | - result.setMsg("获取播放地址失败"); | |
| 259 | + if (streamInfo == null){ | |
| 260 | + throw new ControllerException(ErrorCode.ERROR100.getCode(), "获取播放地址失败"); | |
| 275 | 261 | } |
| 276 | - | |
| 277 | - return result; | |
| 262 | + return streamInfo; | |
| 278 | 263 | } |
| 279 | 264 | |
| 280 | 265 | /** |
| 281 | - * 获取推流播放地址 | |
| 266 | + * 添加推流信息 | |
| 282 | 267 | * @param stream 推流信息 |
| 283 | 268 | * @return |
| 284 | 269 | */ |
| 285 | 270 | @PostMapping(value = "/add") |
| 286 | 271 | @ResponseBody |
| 287 | - @Operation(summary = "停止视频回放") | |
| 288 | - public WVPResult<StreamInfo> add(@RequestBody StreamPushItem stream){ | |
| 272 | + @Operation(summary = "添加推流信息") | |
| 273 | + public void add(@RequestBody StreamPushItem stream){ | |
| 289 | 274 | if (ObjectUtils.isEmpty(stream.getGbId())) { |
| 290 | - | |
| 291 | - return new WVPResult<>(400, "国标ID不可为空", null); | |
| 275 | + throw new ControllerException(ErrorCode.ERROR400.getCode(), "国标ID不可为空"); | |
| 292 | 276 | } |
| 293 | 277 | if (ObjectUtils.isEmpty(stream.getApp()) && ObjectUtils.isEmpty(stream.getStream())) { |
| 294 | - return new WVPResult<>(400, "app或stream不可为空", null); | |
| 278 | + throw new ControllerException(ErrorCode.ERROR400.getCode(), "app或stream不可为空"); | |
| 295 | 279 | } |
| 296 | 280 | stream.setStatus(false); |
| 297 | 281 | stream.setPushIng(false); |
| 298 | 282 | stream.setAliveSecond(0L); |
| 299 | 283 | stream.setTotalReaderCount("0"); |
| 300 | - boolean result = streamPushService.add(stream); | |
| 301 | - | |
| 302 | - if (result) { | |
| 303 | - return new WVPResult<>(0, "success", null); | |
| 304 | - }else { | |
| 305 | - return new WVPResult<>(-1, "fail", null); | |
| 284 | + if (!streamPushService.add(stream)) { | |
| 285 | + throw new ControllerException(ErrorCode.ERROR100); | |
| 306 | 286 | } |
| 307 | 287 | } |
| 308 | 288 | } | ... | ... |
src/main/resources/logback-spring-local.xml
| ... | ... | @@ -77,25 +77,35 @@ |
| 77 | 77 | </encoder> |
| 78 | 78 | </appender> |
| 79 | 79 | |
| 80 | + <!-- 生成 SIP日志追加 --> | |
| 81 | + <appender name="sipRollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
| 82 | + <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> | |
| 83 | + <!--历史日志文件输出的文件名 --> | |
| 84 | + <FileNamePattern>${LOG_HOME}/sip-%d{yyyy-MM-dd}.%i.log</FileNamePattern> | |
| 85 | + <!--日志文件保留天数 --> | |
| 86 | + <MaxHistory>30</MaxHistory> | |
| 87 | + <maxFileSize>50MB</maxFileSize> | |
| 88 | + </rollingPolicy> | |
| 89 | + <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> | |
| 90 | + <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 --> | |
| 91 | + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern> | |
| 92 | + </encoder> | |
| 93 | + </appender> | |
| 94 | + | |
| 80 | 95 | |
| 81 | 96 | <!-- 日志输出级别 --> |
| 82 | 97 | <root level="INFO"> |
| 83 | 98 | <appender-ref ref="STDOUT" /> |
| 84 | - <appender-ref ref="RollingFile" /> | |
| 85 | - <appender-ref ref="RollingFileError" /> | |
| 86 | 99 | </root> |
| 87 | 100 | |
| 88 | -<!-- <logger name="com.genersoft.iot.vmp.storager.dao" level="INFO">--> | |
| 89 | -<!-- <appender-ref ref="STDOUT"/>--> | |
| 90 | -<!-- </logger>--> | |
| 91 | -<!-- <logger name="com.genersoft.iot.vmp.gb28181" level="INFO">--> | |
| 92 | -<!-- <appender-ref ref="STDOUT"/>--> | |
| 93 | -<!-- </logger>--> | |
| 101 | + <logger name="GB28181_SIP" level="debug" additivity="true"> | |
| 102 | + <appender-ref ref="RollingFileError"/> | |
| 103 | + <appender-ref ref="sipRollingFile"/> | |
| 104 | + </logger> | |
| 94 | 105 | |
| 95 | 106 | <!--记录druid-sql的记录--> |
| 96 | - <logger name="druid.sql.Statement" level="debug" additivity="true"> | |
| 107 | + <logger name="com.genersoft.iot.vmp.storager.dao" level="info" additivity="true"> | |
| 97 | 108 | <!--AppenderRef ref="Console"/--> |
| 98 | - <!-- <appender-ref ref="RollingFile"/>--> | |
| 99 | 109 | <appender-ref ref="RollingFileError"/> |
| 100 | 110 | <appender-ref ref="druidSqlRollingFile"/> |
| 101 | 111 | </logger> | ... | ... |
web_src/src/components/dialog/devicePlayer.vue
| ... | ... | @@ -371,7 +371,7 @@ export default { |
| 371 | 371 | if (tab.name === "codec") { |
| 372 | 372 | this.$axios({ |
| 373 | 373 | method: 'get', |
| 374 | - url: '/zlm/' +this.mediaServerId+ '/index/api/getMediaInfo?vhost=__defaultVhost__&schema=rtmp&app='+ this.app +'&stream='+ this.streamId | |
| 374 | + url: '/zlm/' +this.mediaServerId+ '/index/api/getMediaInfo?vhost=__defaultVhost__&schema=rtsp&app='+ this.app +'&stream='+ this.streamId | |
| 375 | 375 | }).then(function (res) { |
| 376 | 376 | that.tracksLoading = false; |
| 377 | 377 | if (res.data.code == 0 && res.data.tracks) { | ... | ... |
web_src/src/components/dialog/platformEdit.vue
| ... | ... | @@ -268,30 +268,29 @@ export default { |
| 268 | 268 | } |
| 269 | 269 | }, |
| 270 | 270 | saveForm: function (){ |
| 271 | - var that = this; | |
| 272 | - that.$axios({ | |
| 271 | + this.$axios({ | |
| 273 | 272 | method: 'post', |
| 274 | 273 | url: this.saveUrl, |
| 275 | - data: that.platform | |
| 276 | - }).then(function (res) { | |
| 274 | + data: this.platform | |
| 275 | + }).then((res) =>{ | |
| 277 | 276 | if (res.data.code === 0) { |
| 278 | - that.$message({ | |
| 277 | + this.$message({ | |
| 279 | 278 | showClose: true, |
| 280 | 279 | message: "保存成功", |
| 281 | 280 | type: "success", |
| 282 | 281 | }); |
| 283 | - that.showDialog = false; | |
| 284 | - if (that.listChangeCallback != null) { | |
| 285 | - that.listChangeCallback(); | |
| 282 | + this.showDialog = false; | |
| 283 | + if (this.listChangeCallback != null) { | |
| 284 | + this.listChangeCallback(); | |
| 286 | 285 | } |
| 287 | 286 | }else { |
| 288 | - that.$message({ | |
| 287 | + this.$message({ | |
| 289 | 288 | showClose: true, |
| 290 | 289 | message: res.data.msg, |
| 291 | 290 | type: "error", |
| 292 | 291 | }); |
| 293 | 292 | } |
| 294 | - }).catch(function (error) { | |
| 293 | + }).catch((error)=> { | |
| 295 | 294 | console.log(error); |
| 296 | 295 | }); |
| 297 | 296 | }, | ... | ... |