From bf8fbf4927d8ddec69893a6bebb79dadf1b4225d Mon Sep 17 00:00:00 2001 From: chenzhangyue Date: Fri, 1 Sep 2023 17:22:53 +0800 Subject: [PATCH 1/5] =?UTF-8?q?bugfix:=E8=BF=99=E9=87=8C=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8key=E6=89=8D=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/service/impl/MediaServerServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java index f8c1ba18a..6bbb4bc35 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java @@ -128,7 +128,7 @@ public class MediaServerServiceImpl implements IMediaServerService { continue; } // 更新 - if (ssrcFactory.hasMediaServerSSRC(mediaServerItem.getId())) { + if (!ssrcFactory.hasMediaServerSSRC(mediaServerItem.getId())) { ssrcFactory.initMediaServerSSRC(mediaServerItem.getId(), null); } // 查询redis是否存在此mediaServer @@ -229,7 +229,7 @@ public class MediaServerServiceImpl implements IMediaServerService { mediaServerMapper.update(mediaSerItem); MediaServerItem mediaServerItemInRedis = getOne(mediaSerItem.getId()); MediaServerItem mediaServerItemInDataBase = mediaServerMapper.queryOne(mediaSerItem.getId()); - if (mediaServerItemInRedis == null || ssrcFactory.hasMediaServerSSRC(mediaSerItem.getId())) { + if (mediaServerItemInRedis == null || !ssrcFactory.hasMediaServerSSRC(mediaSerItem.getId())) { ssrcFactory.initMediaServerSSRC(mediaServerItemInDataBase.getId(),null); } String key = VideoManagerConstants.MEDIA_SERVER_PREFIX + userSetting.getServerId() + "_" + mediaServerItemInDataBase.getId(); @@ -411,7 +411,7 @@ public class MediaServerServiceImpl implements IMediaServerService { } mediaServerMapper.update(serverItem); String key = VideoManagerConstants.MEDIA_SERVER_PREFIX + userSetting.getServerId() + "_" + zlmServerConfig.getGeneralMediaServerId(); - if (ssrcFactory.hasMediaServerSSRC(serverItem.getId())) { + if (!ssrcFactory.hasMediaServerSSRC(serverItem.getId())) { ssrcFactory.initMediaServerSSRC(zlmServerConfig.getGeneralMediaServerId(), null); } redisTemplate.opsForValue().set(key, serverItem); From 73f6f044a1aa58b9c422d19c30198bb515e7616d Mon Sep 17 00:00:00 2001 From: chenzhangyue Date: Fri, 1 Sep 2023 17:53:48 +0800 Subject: [PATCH 2/5] local dev --- src/main/resources/application-dev.yml | 24 ++++++++++++------------ src/main/resources/application.yml | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 504c9c66a..e149886e2 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -19,14 +19,14 @@ spring: # [可选] 数据库 DB database: 7 # [可选] 访问密码,若你的redis服务器没有设置密码,就不需要用密码去连接 - password: + password: luna # [可选] 超时时间 timeout: 10000 # mysql数据源 datasource: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://127.0.0.1:3306/test_gb-89wulian?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true + url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true username: root password: root hikari: @@ -38,7 +38,7 @@ spring: max-lifetime: 1200000 # 是池中连接关闭后的最长生命周期(以毫秒为单位) #[可选] WVP监听的HTTP端口, 网页和接口调用都是这个端口 server: - port: 18978 + port: 8080 # [可选] HTTPS配置, 默认不开启 ssl: # [可选] 是否开启HTTPS访问 @@ -56,7 +56,7 @@ sip: # 如果要监听多张网卡,可以使用逗号分隔多个IP, 例如: 192.168.1.4,10.0.0.4 # 如果不明白,就使用0.0.0.0,大部分情况都是可以的 # 请不要使用127.0.0.1,任何包括localhost在内的域名都是不可以的。 - ip: 192.168.1.18 + ip: 172.19.128.50 # [可选] 28181服务监听的端口 port: 8116 # 根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007) @@ -73,21 +73,21 @@ sip: #zlm 默认服务器配置 media: - id: 89wulian-one + id: zlmediakit-local # [必须修改] zlm服务器的内网IP - ip: 192.168.1.18 + ip: 172.19.128.50 # [必须修改] zlm服务器的http.port - http-port: 80 + http-port: 9092 # [可选] 返回流地址时的ip,置空使用 media.ip - stream-ip: 192.168.1.18 + stream-ip: 172.19.128.50 # [可选] wvp在国标信令中使用的ip,此ip为摄像机可以访问到的ip, 置空使用 media.ip - sdp-ip: 192.168.1.18 + sdp-ip: 172.19.128.50 # [可选] zlm服务器的hook所使用的IP, 默认使用sip.ip - hook-ip: 192.168.1.18 + hook-ip: 172.19.128.50 # [可选] zlm服务器的http.sslport, 置空使用zlm配置文件配置 - http-ssl-port: 443 + http-ssl-port: 1443 # [可选] zlm服务器的hook.admin_params=secret - secret: 035c73f7-bb6b-4889-a715-d9eb2d1925cc + secret: 10000 # 启用多端口模式, 多端口模式使用端口区分每路流,兼容性更好。 单端口使用流的ssrc区分, 点播超时建议使用多端口测试 rtp: # [可选] 是否启用多端口模式, 开启后会在portRange范围内选择端口用于媒体流传输 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 3f478442e..80de5efb4 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -2,4 +2,4 @@ spring: application: name: wvp profiles: - active: local \ No newline at end of file + active: dev \ No newline at end of file From 33d4107d0c1776d730d84998c42b29933673525f Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Wed, 6 Sep 2023 10:21:42 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=97=B6=E5=A6=82=E6=9E=9C=E4=B8=8A=E6=9C=BA=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E8=BF=9E=E6=8E=A5=E7=9A=84=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E6=8C=81=E7=BB=AD=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java | 7 +++---- .../iot/vmp/service/impl/PlatformServiceImpl.java | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java b/src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java index b58b91c55..7760bddfa 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java @@ -14,9 +14,6 @@ import org.springframework.boot.CommandLineRunner; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; -import javax.sip.InvalidArgumentException; -import javax.sip.SipException; -import java.text.ParseException; import java.util.List; /** @@ -61,8 +58,10 @@ public class SipPlatformRunner implements CommandLineRunner { sipCommanderForPlatform.unregister(parentPlatform, parentPlatformCatchOld.getSipTransactionInfo(), null, (eventResult)->{ platformService.login(parentPlatform); }); - } catch (InvalidArgumentException | ParseException | SipException e) { + } catch (Exception e) { logger.error("[命令发送失败] 国标级联 注销: {}", e.getMessage()); + platformService.offline(parentPlatform, true); + continue; } } diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java index 86ee0f4fb..d295ed4c2 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java @@ -276,7 +276,7 @@ public class PlatformServiceImpl implements IPlatformService { eventResult.statusCode, eventResult.msg); offline(parentPlatform, false); }, null); - } catch (InvalidArgumentException | ParseException | SipException e) { + } catch (Exception e) { logger.error("[命令发送失败] 国标级联定时注册: {}", e.getMessage()); } } From 18aff4b546d4f55da8bc8536d5be81e57897d61a Mon Sep 17 00:00:00 2001 From: davidche Date: Wed, 6 Sep 2023 10:30:20 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20#1058?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/service/impl/DeviceServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java index 1dc50f00b..6a44c3a5f 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java @@ -553,7 +553,11 @@ public class DeviceServiceImpl implements IDeviceService { if (device.getCharset() == null) { deviceInStore.setCharset("GB2312"); } - + //SSRC校验 + deviceInStore.setSsrcCheck(device.isSsrcCheck()); + //作为消息通道 + deviceInStore.setAsMessageChannel(device.isAsMessageChannel()); + // 更新redis deviceMapper.updateCustom(deviceInStore); redisCatchStorage.removeDevice(deviceInStore.getDeviceId()); From d02078397e4d71702494a9a24ba7d8ae824fbfc8 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Wed, 6 Sep 2023 16:37:41 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=B5=81=E4=BC=A0=E8=BE=93=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java index 200290eaf..0d99eccd7 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java @@ -514,6 +514,9 @@ public class DeviceServiceImpl implements IDeviceService { if (!ObjectUtils.isEmpty(device.getPassword())) { deviceInStore.setPassword(device.getPassword()); } + if (!ObjectUtils.isEmpty(device.getStreamMode())) { + deviceInStore.setStreamMode(device.getStreamMode()); + } // 目录订阅相关的信息