策略配置文件增加注释与使用Lombok
parent
b759bdcccd
commit
396961ea20
|
@ -1,5 +1,6 @@
|
||||||
package com.genersoft.iot.vmp.conf;
|
package com.genersoft.iot.vmp.conf;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
@ -13,326 +14,160 @@ import java.util.List;
|
||||||
@Component
|
@Component
|
||||||
@ConfigurationProperties(prefix = "user-settings", ignoreInvalidFields = true)
|
@ConfigurationProperties(prefix = "user-settings", ignoreInvalidFields = true)
|
||||||
@Order(0)
|
@Order(0)
|
||||||
|
@Data
|
||||||
public class UserSetting {
|
public class UserSetting {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否保存位置的历史记录(轨迹)
|
||||||
|
*/
|
||||||
private Boolean savePositionHistory = Boolean.FALSE;
|
private Boolean savePositionHistory = Boolean.FALSE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否开始自动点播: 请求流为未拉起的流时,自动开启点播, 需要rtp.enable=true
|
||||||
|
*/
|
||||||
private Boolean autoApplyPlay = Boolean.FALSE;
|
private Boolean autoApplyPlay = Boolean.FALSE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [可选] 部分设备需要扩展SDP,需要打开此设置,一般设备无需打开
|
||||||
|
*/
|
||||||
private Boolean seniorSdp = Boolean.FALSE;
|
private Boolean seniorSdp = Boolean.FALSE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点播/录像回放 等待超时时间,单位:毫秒
|
||||||
|
*/
|
||||||
private Integer playTimeout = 10000;
|
private Integer playTimeout = 10000;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上级点播等待超时时间,单位:毫秒
|
||||||
|
*/
|
||||||
private int platformPlayTimeout = 20000;
|
private int platformPlayTimeout = 20000;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否开启接口鉴权
|
||||||
|
*/
|
||||||
private Boolean interfaceAuthentication = Boolean.TRUE;
|
private Boolean interfaceAuthentication = Boolean.TRUE;
|
||||||
|
|
||||||
private Boolean recordPushLive = Boolean.TRUE;
|
/**
|
||||||
|
* 接口鉴权例外的接口, 即不进行接口鉴权的接口,尽量详细书写,尽量不用/**,至少两级目录
|
||||||
private Boolean recordSip = Boolean.TRUE;
|
*/
|
||||||
|
|
||||||
private Boolean logInDatabase = Boolean.FALSE;
|
|
||||||
|
|
||||||
private Boolean usePushingAsStatus = Boolean.FALSE;
|
|
||||||
|
|
||||||
private Boolean useSourceIpAsStreamIp = Boolean.FALSE;
|
|
||||||
|
|
||||||
private Boolean sipUseSourceIpAsRemoteAddress = Boolean.FALSE;
|
|
||||||
|
|
||||||
private Boolean streamOnDemand = Boolean.TRUE;
|
|
||||||
|
|
||||||
private Boolean pushAuthority = Boolean.TRUE;
|
|
||||||
|
|
||||||
private Boolean syncChannelOnDeviceOnline = Boolean.FALSE;
|
|
||||||
|
|
||||||
private Boolean sipLog = Boolean.FALSE;
|
|
||||||
private Boolean sqlLog = Boolean.FALSE;
|
|
||||||
private Boolean sendToPlatformsWhenIdLost = Boolean.FALSE;
|
|
||||||
|
|
||||||
private Boolean refuseChannelStatusChannelFormNotify = Boolean.FALSE;
|
|
||||||
|
|
||||||
private Boolean deviceStatusNotify = Boolean.TRUE;
|
|
||||||
private Boolean useCustomSsrcForParentInvite = Boolean.TRUE;
|
|
||||||
|
|
||||||
private Boolean docEnable = Boolean.TRUE;
|
|
||||||
|
|
||||||
private String serverId = "000000";
|
|
||||||
|
|
||||||
private String thirdPartyGBIdReg = "[\\s\\S]*";
|
|
||||||
|
|
||||||
private String broadcastForPlatform = "UDP";
|
|
||||||
|
|
||||||
private String civilCodeFile = "classpath:civilCode.csv";
|
|
||||||
|
|
||||||
private List<String> interfaceAuthenticationExcludes = new ArrayList<>();
|
private List<String> interfaceAuthenticationExcludes = new ArrayList<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推流直播是否录制
|
||||||
|
*/
|
||||||
|
private Boolean recordPushLive = Boolean.TRUE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国标是否录制
|
||||||
|
*/
|
||||||
|
private Boolean recordSip = Boolean.TRUE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用推流状态作为推流通道状态
|
||||||
|
*/
|
||||||
|
private Boolean usePushingAsStatus = Boolean.FALSE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用来源请求ip作为streamIp,当且仅当你只有zlm节点它与wvp在一起的情况下开启
|
||||||
|
*/
|
||||||
|
private Boolean useSourceIpAsStreamIp = Boolean.FALSE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否使用设备来源Ip作为回复IP, 不设置则为 false
|
||||||
|
*/
|
||||||
|
private Boolean sipUseSourceIpAsRemoteAddress = Boolean.FALSE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国标点播 按需拉流, true:有人观看拉流,无人观看释放, false:拉起后不自动释放
|
||||||
|
*/
|
||||||
|
private Boolean streamOnDemand = Boolean.TRUE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推流鉴权, 默认开启
|
||||||
|
*/
|
||||||
|
private Boolean pushAuthority = Boolean.TRUE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备上线时是否自动同步通道
|
||||||
|
*/
|
||||||
|
private Boolean syncChannelOnDeviceOnline = Boolean.FALSE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否开启sip日志
|
||||||
|
*/
|
||||||
|
private Boolean sipLog = Boolean.FALSE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否开启mybatis-sql日志
|
||||||
|
*/
|
||||||
|
private Boolean sqlLog = Boolean.FALSE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息通道功能-缺少国标ID是否给所有上级发送消息
|
||||||
|
*/
|
||||||
|
private Boolean sendToPlatformsWhenIdLost = Boolean.FALSE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保持通道状态,不接受notify通道状态变化, 兼容海康平台发送错误消息
|
||||||
|
*/
|
||||||
|
private Boolean refuseChannelStatusChannelFormNotify = Boolean.FALSE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备/通道状态变化时发送消息
|
||||||
|
*/
|
||||||
|
private Boolean deviceStatusNotify = Boolean.TRUE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上级平台点播时不使用上级平台指定的ssrc,使用自定义的ssrc,参考国标文档-点播外域设备媒体流SSRC处理方式
|
||||||
|
*/
|
||||||
|
private Boolean useCustomSsrcForParentInvite = Boolean.TRUE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启接口文档页面。 默认开启,生产环境建议关闭,遇到swagger相关的漏洞时也可以关闭
|
||||||
|
*/
|
||||||
|
private Boolean docEnable = Boolean.TRUE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务ID,不写则为000000
|
||||||
|
*/
|
||||||
|
private String serverId = "000000";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国标级联语音喊话发流模式 * UDP:udp传输 TCP-ACTIVE:tcp主动模式 TCP-PASSIVE:tcp被动模式
|
||||||
|
*/
|
||||||
|
private String broadcastForPlatform = "UDP";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行政区划信息文件,系统启动时会加载到系统里
|
||||||
|
*/
|
||||||
|
private String civilCodeFile = "classpath:civilCode.csv";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跨域配置,不配置此项则允许所有跨域请求,配置后则只允许配置的页面的地址请求, 可以配置多个
|
||||||
|
*/
|
||||||
private List<String> allowedOrigins = new ArrayList<>();
|
private List<String> allowedOrigins = new ArrayList<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置notify缓存队列最大长度,超过此长度的数据将返回486 BUSY_HERE,消息丢弃, 默认100000
|
||||||
|
*/
|
||||||
private int maxNotifyCountQueue = 100000;
|
private int maxNotifyCountQueue = 100000;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国标级联离线后多久重试一次注册
|
||||||
|
*/
|
||||||
private int registerAgainAfterTime = 60;
|
private int registerAgainAfterTime = 60;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国标续订方式,true为续订,每次注册在同一个会话里,false为重新注册,每次使用新的会话
|
||||||
|
*/
|
||||||
private boolean registerKeepIntDialog = false;
|
private boolean registerKeepIntDialog = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* # 国标设备离线后的上线策略,
|
||||||
|
* # 0: 国标标准实现,设备离线后不回复心跳,直到设备重新注册上线,
|
||||||
|
* # 1(默认): 对于离线设备,收到心跳就把设备设置为上线,并更新注册时间为上次这次心跳的时间。防止过期时间判断异常
|
||||||
|
*/
|
||||||
private int gbDeviceOnline = 1;
|
private int gbDeviceOnline = 1;
|
||||||
|
|
||||||
public Boolean getSavePositionHistory() {
|
|
||||||
return savePositionHistory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean isSavePositionHistory() {
|
|
||||||
return savePositionHistory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean isAutoApplyPlay() {
|
|
||||||
return autoApplyPlay;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean isSeniorSdp() {
|
|
||||||
return seniorSdp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getPlayTimeout() {
|
|
||||||
return playTimeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean isInterfaceAuthentication() {
|
|
||||||
return interfaceAuthentication;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean isRecordPushLive() {
|
|
||||||
return recordPushLive;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getInterfaceAuthenticationExcludes() {
|
|
||||||
return interfaceAuthenticationExcludes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSavePositionHistory(Boolean savePositionHistory) {
|
|
||||||
this.savePositionHistory = savePositionHistory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAutoApplyPlay(Boolean autoApplyPlay) {
|
|
||||||
this.autoApplyPlay = autoApplyPlay;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSeniorSdp(Boolean seniorSdp) {
|
|
||||||
this.seniorSdp = seniorSdp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPlayTimeout(Integer playTimeout) {
|
|
||||||
this.playTimeout = playTimeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInterfaceAuthentication(boolean interfaceAuthentication) {
|
|
||||||
this.interfaceAuthentication = interfaceAuthentication;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRecordPushLive(Boolean recordPushLive) {
|
|
||||||
this.recordPushLive = recordPushLive;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInterfaceAuthenticationExcludes(List<String> interfaceAuthenticationExcludes) {
|
|
||||||
this.interfaceAuthenticationExcludes = interfaceAuthenticationExcludes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getLogInDatabase() {
|
|
||||||
return logInDatabase;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLogInDatabase(Boolean logInDatabase) {
|
|
||||||
this.logInDatabase = logInDatabase;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getServerId() {
|
|
||||||
return serverId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setServerId(String serverId) {
|
|
||||||
this.serverId = serverId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getThirdPartyGBIdReg() {
|
|
||||||
return thirdPartyGBIdReg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setThirdPartyGBIdReg(String thirdPartyGBIdReg) {
|
|
||||||
this.thirdPartyGBIdReg = thirdPartyGBIdReg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getRecordSip() {
|
|
||||||
return recordSip;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRecordSip(Boolean recordSip) {
|
|
||||||
this.recordSip = recordSip;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getPlatformPlayTimeout() {
|
|
||||||
return platformPlayTimeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPlatformPlayTimeout(int platformPlayTimeout) {
|
|
||||||
this.platformPlayTimeout = platformPlayTimeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean isUsePushingAsStatus() {
|
|
||||||
return usePushingAsStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUsePushingAsStatus(Boolean usePushingAsStatus) {
|
|
||||||
this.usePushingAsStatus = usePushingAsStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getStreamOnDemand() {
|
|
||||||
return streamOnDemand;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStreamOnDemand(Boolean streamOnDemand) {
|
|
||||||
this.streamOnDemand = streamOnDemand;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getUseSourceIpAsStreamIp() {
|
|
||||||
return useSourceIpAsStreamIp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseSourceIpAsStreamIp(Boolean useSourceIpAsStreamIp) {
|
|
||||||
this.useSourceIpAsStreamIp = useSourceIpAsStreamIp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getPushAuthority() {
|
|
||||||
return pushAuthority;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPushAuthority(Boolean pushAuthority) {
|
|
||||||
this.pushAuthority = pushAuthority;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getSyncChannelOnDeviceOnline() {
|
|
||||||
return syncChannelOnDeviceOnline;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSyncChannelOnDeviceOnline(Boolean syncChannelOnDeviceOnline) {
|
|
||||||
this.syncChannelOnDeviceOnline = syncChannelOnDeviceOnline;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBroadcastForPlatform() {
|
|
||||||
return broadcastForPlatform;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBroadcastForPlatform(String broadcastForPlatform) {
|
|
||||||
this.broadcastForPlatform = broadcastForPlatform;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getSipUseSourceIpAsRemoteAddress() {
|
|
||||||
return sipUseSourceIpAsRemoteAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSipUseSourceIpAsRemoteAddress(Boolean sipUseSourceIpAsRemoteAddress) {
|
|
||||||
this.sipUseSourceIpAsRemoteAddress = sipUseSourceIpAsRemoteAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getSipLog() {
|
|
||||||
return sipLog;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSipLog(Boolean sipLog) {
|
|
||||||
this.sipLog = sipLog;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getAllowedOrigins() {
|
|
||||||
return allowedOrigins;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAllowedOrigins(List<String> allowedOrigins) {
|
|
||||||
this.allowedOrigins = allowedOrigins;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getSendToPlatformsWhenIdLost() {
|
|
||||||
return sendToPlatformsWhenIdLost;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSendToPlatformsWhenIdLost(Boolean sendToPlatformsWhenIdLost) {
|
|
||||||
this.sendToPlatformsWhenIdLost = sendToPlatformsWhenIdLost;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getRefuseChannelStatusChannelFormNotify() {
|
|
||||||
return refuseChannelStatusChannelFormNotify;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRefuseChannelStatusChannelFormNotify(Boolean refuseChannelStatusChannelFormNotify) {
|
|
||||||
this.refuseChannelStatusChannelFormNotify = refuseChannelStatusChannelFormNotify;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMaxNotifyCountQueue() {
|
|
||||||
return maxNotifyCountQueue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMaxNotifyCountQueue(int maxNotifyCountQueue) {
|
|
||||||
this.maxNotifyCountQueue = maxNotifyCountQueue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getDeviceStatusNotify() {
|
|
||||||
return deviceStatusNotify;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeviceStatusNotify(Boolean deviceStatusNotify) {
|
|
||||||
this.deviceStatusNotify = deviceStatusNotify;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getUseCustomSsrcForParentInvite() {
|
|
||||||
return useCustomSsrcForParentInvite;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseCustomSsrcForParentInvite(Boolean useCustomSsrcForParentInvite) {
|
|
||||||
this.useCustomSsrcForParentInvite = useCustomSsrcForParentInvite;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getSqlLog() {
|
|
||||||
return sqlLog;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSqlLog(Boolean sqlLog) {
|
|
||||||
this.sqlLog = sqlLog;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCivilCodeFile() {
|
|
||||||
return civilCodeFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCivilCodeFile(String civilCodeFile) {
|
|
||||||
this.civilCodeFile = civilCodeFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getRegisterAgainAfterTime() {
|
|
||||||
return registerAgainAfterTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRegisterAgainAfterTime(int registerAgainAfterTime) {
|
|
||||||
this.registerAgainAfterTime = registerAgainAfterTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isRegisterKeepIntDialog() {
|
|
||||||
return registerKeepIntDialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRegisterKeepIntDialog(boolean registerKeepIntDialog) {
|
|
||||||
this.registerKeepIntDialog = registerKeepIntDialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getDocEnable() {
|
|
||||||
return docEnable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDocEnable(Boolean docEnable) {
|
|
||||||
this.docEnable = docEnable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getGbDeviceOnline() {
|
|
||||||
return gbDeviceOnline;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGbDeviceOnline(int gbDeviceOnline) {
|
|
||||||
this.gbDeviceOnline = gbDeviceOnline;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!userSetting.isInterfaceAuthentication()) {
|
if (!userSetting.getInterfaceAuthentication()) {
|
||||||
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(null, null, new ArrayList<>() );
|
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(null, null, new ArrayList<>() );
|
||||||
SecurityContextHolder.getContext().setAuthentication(token);
|
SecurityContextHolder.getContext().setAuthentication(token);
|
||||||
chain.doFilter(request, response);
|
chain.doFilter(request, response);
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public void configure(WebSecurity web) {
|
public void configure(WebSecurity web) {
|
||||||
if (userSetting.isInterfaceAuthentication()) {
|
if (userSetting.getInterfaceAuthentication()) {
|
||||||
ArrayList<String> matchers = new ArrayList<>();
|
ArrayList<String> matchers = new ArrayList<>();
|
||||||
matchers.add("/");
|
matchers.add("/");
|
||||||
matchers.add("/#/**");
|
matchers.add("/#/**");
|
||||||
|
|
|
@ -469,7 +469,6 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
|
||||||
if (CollectionUtils.isEmpty(deviceChannelList)) {
|
if (CollectionUtils.isEmpty(deviceChannelList)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
System.out.println("size: " + deviceChannelList.size());
|
|
||||||
List<DeviceChannel> allChannels = channelMapper.queryAllChannelsForRefresh(deviceDbId);
|
List<DeviceChannel> allChannels = channelMapper.queryAllChannelsForRefresh(deviceDbId);
|
||||||
Map<String,DeviceChannel> allChannelMap = new HashMap<>();
|
Map<String,DeviceChannel> allChannelMap = new HashMap<>();
|
||||||
if (!allChannels.isEmpty()) {
|
if (!allChannels.isEmpty()) {
|
||||||
|
|
|
@ -281,7 +281,7 @@ public class SIPCommander implements ISIPCommander {
|
||||||
content.append("c=IN IP4 " + sdpIp + "\r\n");
|
content.append("c=IN IP4 " + sdpIp + "\r\n");
|
||||||
content.append("t=0 0\r\n");
|
content.append("t=0 0\r\n");
|
||||||
|
|
||||||
if (userSetting.isSeniorSdp()) {
|
if (userSetting.getSeniorSdp()) {
|
||||||
if ("TCP-PASSIVE".equalsIgnoreCase(device.getStreamMode())) {
|
if ("TCP-PASSIVE".equalsIgnoreCase(device.getStreamMode())) {
|
||||||
content.append("m=video " + ssrcInfo.getPort() + " TCP/RTP/AVP 96 126 125 99 34 98 97\r\n");
|
content.append("m=video " + ssrcInfo.getPort() + " TCP/RTP/AVP 96 126 125 99 34 98 97\r\n");
|
||||||
} else if ("TCP-ACTIVE".equalsIgnoreCase(device.getStreamMode())) {
|
} else if ("TCP-ACTIVE".equalsIgnoreCase(device.getStreamMode())) {
|
||||||
|
@ -383,7 +383,7 @@ public class SIPCommander implements ISIPCommander {
|
||||||
|
|
||||||
String streamMode = device.getStreamMode();
|
String streamMode = device.getStreamMode();
|
||||||
|
|
||||||
if (userSetting.isSeniorSdp()) {
|
if (userSetting.getSeniorSdp()) {
|
||||||
if ("TCP-PASSIVE".equalsIgnoreCase(streamMode)) {
|
if ("TCP-PASSIVE".equalsIgnoreCase(streamMode)) {
|
||||||
content.append("m=video " + ssrcInfo.getPort() + " TCP/RTP/AVP 96 126 125 99 34 98 97\r\n");
|
content.append("m=video " + ssrcInfo.getPort() + " TCP/RTP/AVP 96 126 125 99 34 98 97\r\n");
|
||||||
} else if ("TCP-ACTIVE".equalsIgnoreCase(streamMode)) {
|
} else if ("TCP-ACTIVE".equalsIgnoreCase(streamMode)) {
|
||||||
|
@ -472,7 +472,7 @@ public class SIPCommander implements ISIPCommander {
|
||||||
|
|
||||||
String streamMode = device.getStreamMode().toUpperCase();
|
String streamMode = device.getStreamMode().toUpperCase();
|
||||||
|
|
||||||
if (userSetting.isSeniorSdp()) {
|
if (userSetting.getSeniorSdp()) {
|
||||||
if ("TCP-PASSIVE".equals(streamMode)) {
|
if ("TCP-PASSIVE".equals(streamMode)) {
|
||||||
content.append("m=video " + ssrcInfo.getPort() + " TCP/RTP/AVP 96 126 125 99 34 98 97\r\n");
|
content.append("m=video " + ssrcInfo.getPort() + " TCP/RTP/AVP 96 126 125 99 34 98 97\r\n");
|
||||||
} else if ("TCP-ACTIVE".equals(streamMode)) {
|
} else if ("TCP-ACTIVE".equals(streamMode)) {
|
||||||
|
|
|
@ -209,7 +209,7 @@ public class ZLMHttpHookListener {
|
||||||
|
|
||||||
|
|
||||||
MediaServer mediaServer = mediaServerService.getOne(param.getMediaServerId());
|
MediaServer mediaServer = mediaServerService.getOne(param.getMediaServerId());
|
||||||
if (!userSetting.isAutoApplyPlay() || mediaServer == null) {
|
if (!userSetting.getAutoApplyPlay() || mediaServer == null) {
|
||||||
return HookResult.SUCCESS();
|
return HookResult.SUCCESS();
|
||||||
}
|
}
|
||||||
MediaNotFoundEvent mediaNotFoundEvent = MediaNotFoundEvent.getInstance(this, param, mediaServer);
|
MediaNotFoundEvent mediaNotFoundEvent = MediaNotFoundEvent.getInstance(this, param, mediaServer);
|
||||||
|
|
|
@ -123,7 +123,7 @@ public class MediaServiceImpl implements IMediaService {
|
||||||
if ("rtp".equals(app)) {
|
if ("rtp".equals(app)) {
|
||||||
result.setEnable_mp4(userSetting.getRecordSip());
|
result.setEnable_mp4(userSetting.getRecordSip());
|
||||||
} else {
|
} else {
|
||||||
result.setEnable_mp4(userSetting.isRecordPushLive());
|
result.setEnable_mp4(userSetting.getRecordPushLive());
|
||||||
}
|
}
|
||||||
// 国标流
|
// 国标流
|
||||||
if ("rtp".equals(app)) {
|
if ("rtp".equals(app)) {
|
||||||
|
|
|
@ -100,7 +100,7 @@ public class RedisPushStreamStatusMsgListener implements MessageListener, Applic
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(ApplicationArguments args) throws Exception {
|
public void run(ApplicationArguments args) throws Exception {
|
||||||
if (userSetting.isUsePushingAsStatus()) {
|
if (userSetting.getUsePushingAsStatus()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 查询是否存在推流设备,没有则不发送
|
// 查询是否存在推流设备,没有则不发送
|
||||||
|
|
|
@ -284,7 +284,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||||
mediaServerService.closeStreams(mediaServer, streamPush.getApp(), streamPush.getStream());
|
mediaServerService.closeStreams(mediaServer, streamPush.getApp(), streamPush.getStream());
|
||||||
}
|
}
|
||||||
streamPush.setPushing(false);
|
streamPush.setPushing(false);
|
||||||
if (userSetting.isUsePushingAsStatus()) {
|
if (userSetting.getUsePushingAsStatus()) {
|
||||||
CommonGBChannel commonGBChannel = streamPush.buildCommonGBChannel();
|
CommonGBChannel commonGBChannel = streamPush.buildCommonGBChannel();
|
||||||
if (commonGBChannel != null) {
|
if (commonGBChannel != null) {
|
||||||
gbChannelService.offline(commonGBChannel);
|
gbChannelService.offline(commonGBChannel);
|
||||||
|
@ -474,7 +474,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||||
@Override
|
@Override
|
||||||
public ResourceBaseInfo getOverview() {
|
public ResourceBaseInfo getOverview() {
|
||||||
int total = streamPushMapper.getAllCount();
|
int total = streamPushMapper.getAllCount();
|
||||||
int online = streamPushMapper.getAllPushing(userSetting.isUsePushingAsStatus());
|
int online = streamPushMapper.getAllPushing(userSetting.getUsePushingAsStatus());
|
||||||
|
|
||||||
return new ResourceBaseInfo(total, online);
|
return new ResourceBaseInfo(total, online);
|
||||||
}
|
}
|
||||||
|
@ -500,7 +500,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updatePushStatus(StreamPush streamPush, boolean pushIng) {
|
public void updatePushStatus(StreamPush streamPush, boolean pushIng) {
|
||||||
streamPush.setPushing(pushIng);
|
streamPush.setPushing(pushIng);
|
||||||
if (userSetting.isUsePushingAsStatus()) {
|
if (userSetting.getUsePushingAsStatus()) {
|
||||||
streamPush.setGbStatus(pushIng?"ON":"OFF");
|
streamPush.setGbStatus(pushIng?"ON":"OFF");
|
||||||
}
|
}
|
||||||
streamPush.setPushTime(DateUtil.getNow());
|
streamPush.setPushTime(DateUtil.getNow());
|
||||||
|
@ -508,7 +508,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||||
if (ObjectUtils.isEmpty(streamPush.getGbDeviceId())) {
|
if (ObjectUtils.isEmpty(streamPush.getGbDeviceId())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (userSetting.isUsePushingAsStatus()) {
|
if (userSetting.getUsePushingAsStatus()) {
|
||||||
if ("ON".equalsIgnoreCase(streamPush.getGbStatus()) ) {
|
if ("ON".equalsIgnoreCase(streamPush.getGbStatus()) ) {
|
||||||
gbChannelService.online(streamPush.buildCommonGBChannel());
|
gbChannelService.online(streamPush.buildCommonGBChannel());
|
||||||
}else {
|
}else {
|
||||||
|
|
Loading…
Reference in New Issue