diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/task/SipRunner.java b/src/main/java/com/genersoft/iot/vmp/gb28181/task/SipRunner.java index b61a623f..e2b2223f 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/task/SipRunner.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/task/SipRunner.java @@ -104,7 +104,7 @@ public class SipRunner implements CommandLineRunner { redisCatchStorage.deleteSendRTPServer(sendRtpItem.getPlatformId(),sendRtpItem.getChannelId(), sendRtpItem.getCallId(),sendRtpItem.getStream()); if (mediaServerItem != null) { ssrcFactory.releaseSsrc(sendRtpItem.getMediaServerId(), sendRtpItem.getSsrc()); - boolean stopResult = mediaServerService.stopSendRtp(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getSsrc()); + boolean stopResult = mediaServerService.initStopSendRtp(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getSsrc()); if (stopResult) { ParentPlatform platform = platformService.queryPlatformByServerGBId(sendRtpItem.getPlatformId()); if (platform != null) { diff --git a/src/main/java/com/genersoft/iot/vmp/media/service/IMediaNodeServerService.java b/src/main/java/com/genersoft/iot/vmp/media/service/IMediaNodeServerService.java index 87399382..a3916b36 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/service/IMediaNodeServerService.java +++ b/src/main/java/com/genersoft/iot/vmp/media/service/IMediaNodeServerService.java @@ -29,6 +29,8 @@ public interface IMediaNodeServerService { boolean stopSendRtp(MediaServer mediaInfo, String app, String stream, String ssrc); + boolean initStopSendRtp(MediaServer mediaInfo, String app, String stream, String ssrc); + boolean deleteRecordDirectory(MediaServer mediaServer, String app, String stream, String date, String fileName); List getMediaList(MediaServer mediaServer, String app, String stream, String callId); diff --git a/src/main/java/com/genersoft/iot/vmp/media/service/IMediaServerService.java b/src/main/java/com/genersoft/iot/vmp/media/service/IMediaServerService.java index 11d5bf56..cde96df1 100755 --- a/src/main/java/com/genersoft/iot/vmp/media/service/IMediaServerService.java +++ b/src/main/java/com/genersoft/iot/vmp/media/service/IMediaServerService.java @@ -76,6 +76,8 @@ public interface IMediaServerService { boolean stopSendRtp(MediaServer mediaInfo, String app, String stream, String ssrc); + boolean initStopSendRtp(MediaServer mediaInfo, String app, String stream, String ssrc); + boolean deleteRecordDirectory(MediaServer mediaServerItem, String app, String stream, String date, String fileName); List getMediaList(MediaServer mediaInfo, String app, String stream, String callId); diff --git a/src/main/java/com/genersoft/iot/vmp/media/service/impl/MediaServerServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/media/service/impl/MediaServerServiceImpl.java index ae386fc9..2dd66e73 100755 --- a/src/main/java/com/genersoft/iot/vmp/media/service/impl/MediaServerServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/media/service/impl/MediaServerServiceImpl.java @@ -595,6 +595,16 @@ public class MediaServerServiceImpl implements IMediaServerService { return mediaNodeServerService.stopSendRtp(mediaInfo, app, stream, ssrc); } + @Override + public boolean initStopSendRtp(MediaServer mediaInfo, String app, String stream, String ssrc) { + IMediaNodeServerService mediaNodeServerService = nodeServerServiceMap.get(mediaInfo.getType()); + if (mediaNodeServerService == null) { + logger.info("[stopSendRtp] 失败, mediaServer的类型: {},未找到对应的实现类", mediaInfo.getType()); + return false; + } + return mediaNodeServerService.initStopSendRtp(mediaInfo, app, stream, ssrc); + } + @Override public boolean deleteRecordDirectory(MediaServer mediaServer, String app, String stream, String date, String fileName) { IMediaNodeServerService mediaNodeServerService = nodeServerServiceMap.get(mediaServer.getType()); diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaNodeServerService.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaNodeServerService.java index e91ced9d..4cfdaf32 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaNodeServerService.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaNodeServerService.java @@ -144,6 +144,23 @@ public class ZLMMediaNodeServerService implements IMediaNodeServerService { } + @Override + public boolean initStopSendRtp(MediaServer mediaInfo, String app, String stream, String ssrc) { + Map param = new HashMap<>(); + param.put("vhost", "__defaultVhost__"); + param.put("app", app); + param.put("stream", stream); + if (!ObjectUtils.isEmpty(ssrc)) { + param.put("ssrc", ssrc); + } + JSONObject jsonObject = zlmresTfulUtils.stopSendRtp(mediaInfo, param); + if (jsonObject == null || jsonObject.getInteger("code") != 0 ) { + logger.error("停止发流失败: {}, 参数:{}", jsonObject.getString("msg"), JSON.toJSONString(param)); + return false; + } + return true; + } + @Override public boolean deleteRecordDirectory(MediaServer mediaServer, String app, String stream, String date, String fileName) { logger.info("[zlm-deleteRecordDirectory] 删除磁盘文件, server: {} {}:{}->{}/{}", mediaServer.getId(), app, stream, date, fileName); diff --git a/web_src/src/components/dialog/platformEdit.vue b/web_src/src/components/dialog/platformEdit.vue index 06cb7c41..0a752222 100755 --- a/web_src/src/components/dialog/platformEdit.vue +++ b/web_src/src/components/dialog/platformEdit.vue @@ -34,7 +34,7 @@ @@ -58,7 +58,7 @@ - + @@ -100,16 +100,17 @@ - + - - + + {{ - onSubmit_text - }} + onSubmit_text + }} + 取消 @@ -172,52 +173,56 @@ export default { administrativeDivision: "", sendStreamIp: null, }, - deviceIp: [], // 存储用户选择的设备IP + deviceIps: [], // 存储用户设备IP数组 rules: { - name: [{ required: true, message: "请输入平台名称", trigger: "blur" }], + name: [{required: true, message: "请输入平台名称", trigger: "blur"}], serverGBId: [ - { required: true, message: "请输入SIP服务国标编码", trigger: "blur" }, + {required: true, message: "请输入SIP服务国标编码", trigger: "blur"}, ], serverGBDomain: [ - { required: true, message: "请输入SIP服务国标域", trigger: "blur" }, + {required: true, message: "请输入SIP服务国标域", trigger: "blur"}, ], - serverIP: [{ required: true, message: "请输入SIP服务IP", trigger: "blur" }], - serverPort: [{ required: true, message: "请输入SIP服务端口", trigger: "blur" }], - deviceGBId: [{ validator: deviceGBIdRules, trigger: "blur" }], - username: [{ required: false, message: "请输入SIP认证用户名", trigger: "blur" }], - password: [{ required: false, message: "请输入SIP认证密码", trigger: "blur" }], - expires: [{ required: true, message: "请输入注册周期", trigger: "blur" }], - keepTimeout: [{ required: true, message: "请输入心跳周期", trigger: "blur" }], - transport: [{ required: true, message: "请选择信令传输", trigger: "blur" }], - characterSet: [{ required: true, message: "请选择编码字符集", trigger: "blur" }], + serverIP: [{required: true, message: "请输入SIP服务IP", trigger: "blur"}], + serverPort: [{required: true, message: "请输入SIP服务端口", trigger: "blur"}], + deviceGBId: [{validator: deviceGBIdRules, trigger: "blur"}], + username: [{required: false, message: "请输入SIP认证用户名", trigger: "blur"}], + password: [{required: false, message: "请输入SIP认证密码", trigger: "blur"}], + expires: [{required: true, message: "请输入注册周期", trigger: "blur"}], + keepTimeout: [{required: true, message: "请输入心跳周期", trigger: "blur"}], + transport: [{required: true, message: "请选择信令传输", trigger: "blur"}], + characterSet: [{required: true, message: "请选择编码字符集", trigger: "blur"}], + deviceIp: [{required: true, message: "请选择本地IP", trigger: "blur"}], }, }; }, methods: { openDialog: function (platform, callback) { var that = this; - if (platform == null) { - this.onSubmit_text = "立即创建"; - this.saveUrl = "/api/platform/add"; - this.$axios({ - method: 'get', - url:`/api/platform/server_config` - }).then(function (res) { - console.log(res); + this.$axios({ + method: 'get', + url: `/api/platform/server_config` + }).then(function (res) { + if (platform == null) { if (res.data.code === 0) { that.platform.deviceGBId = res.data.data.username; - that.deviceIp = res.data.data.deviceIp.split(','); + that.deviceIps = res.data.data.deviceIp.split(','); + that.platform.deviceIp = that.deviceIps[0]; that.platform.devicePort = res.data.data.devicePort; that.platform.username = res.data.data.username; that.platform.password = res.data.data.password; that.platform.sendStreamIp = res.data.data.sendStreamIp; that.platform.administrativeDivision = res.data.data.username.substr(0, 6); } - - }).catch(function (error) { - console.log(error); - }); - }else { + } else { + that.deviceIps = res.data.data.deviceIp.split(','); + } + }).catch(function (error) { + console.log(error); + }); + if (platform == null) { + this.onSubmit_text = "立即创建"; + this.saveUrl = "/api/platform/add"; + } else { this.platform.id = platform.id; this.platform.enable = platform.enable; this.platform.ptz = platform.ptz; @@ -230,7 +235,7 @@ export default { this.platform.serverIP = platform.serverIP; this.platform.serverPort = platform.serverPort; this.platform.deviceGBId = platform.deviceGBId; - this.deviceIp = platform.deviceIp.split(','); + this.platform.deviceIp = platform.deviceIp; this.platform.devicePort = platform.devicePort; this.platform.username = platform.username; this.platform.password = platform.password; @@ -256,7 +261,7 @@ export default { }, deviceGBIdChange: function () { - this.platform.username = this.platform.deviceGBId ; + this.platform.username = this.platform.deviceGBId; if (this.platform.administrativeDivision == null) { this.platform.administrativeDivision = this.platform.deviceGBId.substr(0, 6); } @@ -264,12 +269,12 @@ export default { onSubmit: function () { this.saveForm() }, - saveForm: function (){ + saveForm: function () { this.$axios({ method: 'post', url: this.saveUrl, data: this.platform - }).then((res) =>{ + }).then((res) => { if (res.data.code === 0) { this.$message({ showClose: true, @@ -280,14 +285,14 @@ export default { if (this.listChangeCallback != null) { this.listChangeCallback(); } - }else { + } else { this.$message({ showClose: true, message: res.data.msg, type: "error", }); } - }).catch((error)=> { + }).catch((error) => { console.log(error); }); }, @@ -325,24 +330,25 @@ export default { var result = false; var that = this; await that.$axios({ - method: 'get', - url:`/api/platform/exit/${deviceGbId}`}) + method: 'get', + url: `/api/platform/exit/${deviceGbId}` + }) .then(function (res) { - if (res.data.code === 0) { - result = res.data.data; - } + if (res.data.code === 0) { + result = res.data.data; + } }) .catch(function (error) { console.log(error); }); return result; }, - checkExpires: function() { + checkExpires: function () { if (this.platform.enable && this.platform.expires === "0") { this.platform.expires = "3600"; } }, - rtcpCheckBoxChange: function (result){ + rtcpCheckBoxChange: function (result) { if (result) { this.$message({ showClose: true, @@ -363,10 +369,12 @@ input::-webkit-inner-spin-button { appearance: none; margin: 0; } + /* 火狐 */ -input{ - -moz-appearance:textfield; +input { + -moz-appearance: textfield; } + .control-wrapper-not-used { position: relative; width: 6.25rem;