Merge branch 'wvp-28181-2.0' into database-structure-optimization

结构优化
648540858 2023-08-25 09:17:28 +08:00
commit 288b4d4a41
8 changed files with 22 additions and 26 deletions

View File

@ -153,7 +153,7 @@ user-settings:
# 国标是否录制 # 国标是否录制
record-sip: true record-sip: true
# 是否将日志存储进数据库 # 是否将日志存储进数据库
logInDatebase: true logInDatabase: true
# 第三方匹配用于从stream钟获取有效信息 # 第三方匹配用于从stream钟获取有效信息
thirdPartyGBIdReg: [\s\S]* thirdPartyGBIdReg: [\s\S]*
``` ```

View File

@ -51,7 +51,7 @@ public class ApiAccessFilter extends OncePerRequestFilter {
filterChain.doFilter(servletRequest, servletResponse); filterChain.doFilter(servletRequest, servletResponse);
if (uriName != null && userSetting != null && userSetting.getLogInDatebase() != null && userSetting.getLogInDatebase()) { if (uriName != null && userSetting != null && userSetting.getLogInDatabase() != null && userSetting.getLogInDatabase()) {
LogDto logDto = new LogDto(); LogDto logDto = new LogDto();
logDto.setName(uriName); logDto.setName(uriName);

View File

@ -31,7 +31,7 @@ public class UserSetting {
private Boolean recordSip = Boolean.TRUE; private Boolean recordSip = Boolean.TRUE;
private Boolean logInDatebase = Boolean.TRUE; private Boolean logInDatabase = Boolean.TRUE;
private Boolean usePushingAsStatus = Boolean.TRUE; private Boolean usePushingAsStatus = Boolean.TRUE;
@ -132,12 +132,12 @@ public class UserSetting {
this.interfaceAuthenticationExcludes = interfaceAuthenticationExcludes; this.interfaceAuthenticationExcludes = interfaceAuthenticationExcludes;
} }
public Boolean getLogInDatebase() { public Boolean getLogInDatabase() {
return logInDatebase; return logInDatabase;
} }
public void setLogInDatebase(Boolean logInDatebase) { public void setLogInDatabase(Boolean logInDatabase) {
this.logInDatebase = logInDatebase; this.logInDatabase = logInDatabase;
} }
public String getServerId() { public String getServerId() {

View File

@ -18,10 +18,7 @@ import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory;
import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe;
import com.genersoft.iot.vmp.media.zlm.dto.*; import com.genersoft.iot.vmp.media.zlm.dto.*;
import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam; import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam;
import com.genersoft.iot.vmp.service.IMediaServerService; import com.genersoft.iot.vmp.service.*;
import com.genersoft.iot.vmp.service.IPlayService;
import com.genersoft.iot.vmp.service.IStreamProxyService;
import com.genersoft.iot.vmp.service.IStreamPushService;
import com.genersoft.iot.vmp.service.bean.ErrorCallback; import com.genersoft.iot.vmp.service.bean.ErrorCallback;
import com.genersoft.iot.vmp.service.bean.InviteErrorCode; import com.genersoft.iot.vmp.service.bean.InviteErrorCode;
import com.genersoft.iot.vmp.service.bean.MessageForPushChannel; import com.genersoft.iot.vmp.service.bean.MessageForPushChannel;
@ -79,6 +76,9 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
@Autowired @Autowired
private IRedisCatchStorage redisCatchStorage; private IRedisCatchStorage redisCatchStorage;
@Autowired
private IInviteStreamService inviteStreamService;
@Autowired @Autowired
private SSRCFactory ssrcFactory; private SSRCFactory ssrcFactory;
@ -479,13 +479,13 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
errorEvent.run(code, msg, data); errorEvent.run(code, msg, data);
} }
}); });
}else if ("Download".equalsIgnoreCase(sessionName)) { } else if ("Download".equalsIgnoreCase(sessionName)) {
// 获取指定的下载速度 // 获取指定的下载速度
Vector sdpMediaDescriptions = sdp.getMediaDescriptions(true); Vector sdpMediaDescriptions = sdp.getMediaDescriptions(true);
MediaDescription mediaDescription = null; MediaDescription mediaDescription = null;
String downloadSpeed = "1"; String downloadSpeed = "1";
if (sdpMediaDescriptions.size() > 0) { if (sdpMediaDescriptions.size() > 0) {
mediaDescription = (MediaDescription)sdpMediaDescriptions.get(0); mediaDescription = (MediaDescription) sdpMediaDescriptions.get(0);
} }
if (mediaDescription != null) { if (mediaDescription != null) {
downloadSpeed = mediaDescription.getAttribute("downloadspeed"); downloadSpeed = mediaDescription.getAttribute("downloadspeed");
@ -499,26 +499,26 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
playService.download(mediaServerItem, ssrcInfo, device.getDeviceId(), channelId, DateUtil.formatter.format(start), playService.download(mediaServerItem, ssrcInfo, device.getDeviceId(), channelId, DateUtil.formatter.format(start),
DateUtil.formatter.format(end), Integer.parseInt(downloadSpeed), DateUtil.formatter.format(end), Integer.parseInt(downloadSpeed),
(code, msg, data) -> { (code, msg, data) -> {
if (code == InviteErrorCode.SUCCESS.getCode()){ if (code == InviteErrorCode.SUCCESS.getCode()) {
hookEvent.run(code, msg, data); hookEvent.run(code, msg, data);
}else if (code == InviteErrorCode.ERROR_FOR_SIGNALLING_TIMEOUT.getCode() || code == InviteErrorCode.ERROR_FOR_STREAM_TIMEOUT.getCode()){ } else if (code == InviteErrorCode.ERROR_FOR_SIGNALLING_TIMEOUT.getCode() || code == InviteErrorCode.ERROR_FOR_STREAM_TIMEOUT.getCode()) {
logger.info("[录像下载]超时, 用户:{} 通道:{}", username, channelId); logger.info("[录像下载]超时, 用户:{} 通道:{}", username, channelId);
redisCatchStorage.deleteSendRTPServer(platform.getServerGBId(), channelId, callIdHeader.getCallId(), null); redisCatchStorage.deleteSendRTPServer(platform.getServerGBId(), channelId, callIdHeader.getCallId(), null);
errorEvent.run(code, msg, data); errorEvent.run(code, msg, data);
}else { } else {
errorEvent.run(code, msg, data); errorEvent.run(code, msg, data);
} }
}); });
}else { } else {
SSRCInfo ssrcInfo = playService.play(mediaServerItem, device.getDeviceId(), channelId, ssrc, ((code, msg, data) -> { SSRCInfo ssrcInfo = playService.play(mediaServerItem, device.getDeviceId(), channelId, ssrc, ((code, msg, data) -> {
if (code == InviteErrorCode.SUCCESS.getCode()){ if (code == InviteErrorCode.SUCCESS.getCode()) {
hookEvent.run(code, msg, data); hookEvent.run(code, msg, data);
}else if (code == InviteErrorCode.ERROR_FOR_SIGNALLING_TIMEOUT.getCode() || code == InviteErrorCode.ERROR_FOR_STREAM_TIMEOUT.getCode()){ } else if (code == InviteErrorCode.ERROR_FOR_SIGNALLING_TIMEOUT.getCode() || code == InviteErrorCode.ERROR_FOR_STREAM_TIMEOUT.getCode()) {
logger.info("[上级点播]超时, 用户:{} 通道:{}", username, channelId); logger.info("[上级点播]超时, 用户:{} 通道:{}", username, channelId);
redisCatchStorage.deleteSendRTPServer(platform.getServerGBId(), channelId, callIdHeader.getCallId(), null); redisCatchStorage.deleteSendRTPServer(platform.getServerGBId(), channelId, callIdHeader.getCallId(), null);
errorEvent.run(code, msg, data); errorEvent.run(code, msg, data);
}else { } else {
errorEvent.run(code, msg, data); errorEvent.run(code, msg, data);
} }
})); }));

View File

@ -61,7 +61,7 @@ public class LogController {
query = null; query = null;
} }
if (!userSetting.getLogInDatebase()) { if (!userSetting.getLogInDatabase()) {
logger.warn("自动记录日志功能已关闭,查询结果可能不完整。"); logger.warn("自动记录日志功能已关闭,查询结果可能不完整。");
} }

View File

@ -223,8 +223,6 @@ public class PsController {
String is_Udp = isUdp ? "1" : "0"; String is_Udp = isUdp ? "1" : "0";
param.put("is_udp", is_Udp); param.put("is_udp", is_Udp);
param.put("src_port", sendInfo.getSendLocalPort()); param.put("src_port", sendInfo.getSendLocalPort());
param.put("use_ps", "0");
param.put("only_audio", "1");
Boolean streamReady = zlmServerFactory.isStreamReady(mediaServerItem, app, stream); Boolean streamReady = zlmServerFactory.isStreamReady(mediaServerItem, app, stream);

View File

@ -247,7 +247,6 @@ public class RtpController {
String is_Udp = isUdp ? "1" : "0"; String is_Udp = isUdp ? "1" : "0";
paramForAudio.put("is_udp", is_Udp); paramForAudio.put("is_udp", is_Udp);
paramForAudio.put("src_port", sendInfo.getSendLocalPortForAudio()); paramForAudio.put("src_port", sendInfo.getSendLocalPortForAudio());
paramForAudio.put("use_ps", "0");
paramForAudio.put("only_audio", "1"); paramForAudio.put("only_audio", "1");
if (ptForAudio != null) { if (ptForAudio != null) {
paramForAudio.put("pt", ptForAudio); paramForAudio.put("pt", ptForAudio);
@ -268,7 +267,6 @@ public class RtpController {
String is_Udp = isUdp ? "1" : "0"; String is_Udp = isUdp ? "1" : "0";
paramForVideo.put("is_udp", is_Udp); paramForVideo.put("is_udp", is_Udp);
paramForVideo.put("src_port", sendInfo.getSendLocalPortForVideo()); paramForVideo.put("src_port", sendInfo.getSendLocalPortForVideo());
paramForVideo.put("use_ps", "0");
paramForVideo.put("only_audio", "0"); paramForVideo.put("only_audio", "0");
if (ptForVideo != null) { if (ptForVideo != null) {
paramForVideo.put("pt", ptForVideo); paramForVideo.put("pt", ptForVideo);

View File

@ -178,7 +178,7 @@ user-settings:
# 国标是否录制 # 国标是否录制
record-sip: true record-sip: true
# 是否将日志存储进数据库 # 是否将日志存储进数据库
logInDatebase: true logInDatabase: true
# 使用推流状态作为推流通道状态 # 使用推流状态作为推流通道状态
use-pushing-as-status: true use-pushing-as-status: true
# 使用来源请求ip作为streamIp,当且仅当你只有zlm节点它与wvp在一起的情况下开启 # 使用来源请求ip作为streamIp,当且仅当你只有zlm节点它与wvp在一起的情况下开启