Merge branch 'wvp-28181-2.0' into dev-wvp-0906

pull/1067/head
chenzhangyue 2023-09-10 17:49:28 +08:00
commit 0222a1e70d
6 changed files with 28 additions and 22 deletions

View File

@ -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;
}
}

View File

@ -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());
}
// 目录订阅相关的信息
@ -557,7 +560,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());

View File

@ -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);

View File

@ -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());
}
}

View File

@ -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范围内选择端口用于媒体流传输

View File

@ -2,4 +2,4 @@ spring:
application:
name: wvp
profiles:
active: local
active: dev