合并主线

结构优化
648540858 2022-10-17 17:02:16 +08:00
parent 82fd369ce5
commit f6320c7dd3
4 changed files with 92 additions and 85 deletions

View File

@ -1,4 +1,4 @@
alter table wvp.media_server alter table media_server
drop column streamNoneReaderDelayMS; drop column streamNoneReaderDelayMS;
alter table stream_proxy alter table stream_proxy

View File

@ -896,7 +896,11 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
AudioBroadcastCatch audioBroadcastCatch = audioBroadcastManager.get(requesterId, channelId); AudioBroadcastCatch audioBroadcastCatch = audioBroadcastManager.get(requesterId, channelId);
if (audioBroadcastCatch == null) { if (audioBroadcastCatch == null) {
logger.warn("来自设备的Invite请求非语音广播已忽略requesterId {}/{}", requesterId, channelId); logger.warn("来自设备的Invite请求非语音广播已忽略requesterId {}/{}", requesterId, channelId);
try {
responseAck(serverTransaction, Response.FORBIDDEN); responseAck(serverTransaction, Response.FORBIDDEN);
} catch (SipException | InvalidArgumentException | ParseException e) {
logger.error("[命令发送失败] 来自设备的Invite请求非语音广播 FORBIDDEN: {}", e.getMessage());
}
return; return;
} }
Request request = serverTransaction.getRequest(); Request request = serverTransaction.getRequest();
@ -920,6 +924,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
if (ssrcIndex > 0) { if (ssrcIndex > 0) {
substring = contentString.substring(0, ssrcIndex); substring = contentString.substring(0, ssrcIndex);
} }
try {
SessionDescription sdp = SdpFactory.getInstance().createSessionDescription(substring); SessionDescription sdp = SdpFactory.getInstance().createSessionDescription(substring);
// 获取支持的格式 // 获取支持的格式
@ -955,7 +960,11 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
if (port == -1) { if (port == -1) {
logger.info("不支持的媒体格式返回415"); logger.info("不支持的媒体格式返回415");
// 回复不支持的格式 // 回复不支持的格式
try {
responseAck(serverTransaction, Response.UNSUPPORTED_MEDIA_TYPE); // 不支持的格式发415 responseAck(serverTransaction, Response.UNSUPPORTED_MEDIA_TYPE); // 不支持的格式发415
} catch (SipException | InvalidArgumentException | ParseException e) {
logger.error("[命令发送失败] invite 不支持的媒体格式: {}", e.getMessage());
}
return; return;
} }
String addressStr = sdp.getOrigin().getAddress(); String addressStr = sdp.getOrigin().getAddress();
@ -964,7 +973,11 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
MediaServerItem mediaServerItem = playService.getNewMediaServerItem(device); MediaServerItem mediaServerItem = playService.getNewMediaServerItem(device);
if (mediaServerItem == null) { if (mediaServerItem == null) {
logger.warn("未找到可用的zlm"); logger.warn("未找到可用的zlm");
try {
responseAck(serverTransaction, Response.BUSY_HERE); responseAck(serverTransaction, Response.BUSY_HERE);
} catch (SipException | InvalidArgumentException | ParseException e) {
logger.error("[命令发送失败] invite 未找到可用的zlm: {}", e.getMessage());
}
return; return;
} }
SendRtpItem sendRtpItem = zlmrtpServerFactory.createSendRtpItem(mediaServerItem, addressStr, port, ssrc, requesterId, SendRtpItem sendRtpItem = zlmrtpServerFactory.createSendRtpItem(mediaServerItem, addressStr, port, ssrc, requesterId,
@ -972,7 +985,11 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
mediaTransmissionTCP); mediaTransmissionTCP);
if (sendRtpItem == null) { if (sendRtpItem == null) {
logger.warn("服务器端口资源不足"); logger.warn("服务器端口资源不足");
try {
responseAck(serverTransaction, Response.BUSY_HERE); responseAck(serverTransaction, Response.BUSY_HERE);
} catch (SipException | InvalidArgumentException | ParseException e) {
logger.error("[命令发送失败] invite 服务器端口资源不足: {}", e.getMessage());
}
return; return;
} }
sendRtpItem.setTcp(mediaTransmissionTCP); sendRtpItem.setTcp(mediaTransmissionTCP);
@ -1001,6 +1018,9 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
logger.warn("[语音通话] 未发现待推送的流,app={},stream={}", app, stream); logger.warn("[语音通话] 未发现待推送的流,app={},stream={}", app, stream);
playService.stopAudioBroadcast(device.getDeviceId(), audioBroadcastCatch.getChannelId()); playService.stopAudioBroadcast(device.getDeviceId(), audioBroadcastCatch.getChannelId());
} }
} catch (SdpException e) {
logger.error("[SDP解析异常]", e);
}
} else { } else {
logger.warn("来自无效设备/平台的请求"); logger.warn("来自无效设备/平台的请求");
try { try {

View File

@ -11,7 +11,6 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor; import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
import com.genersoft.iot.vmp.gb28181.utils.Coordtransform;
import com.genersoft.iot.vmp.gb28181.utils.NumericUtil; import com.genersoft.iot.vmp.gb28181.utils.NumericUtil;
import com.genersoft.iot.vmp.gb28181.utils.SipUtils; import com.genersoft.iot.vmp.gb28181.utils.SipUtils;
import com.genersoft.iot.vmp.gb28181.utils.XmlUtil; import com.genersoft.iot.vmp.gb28181.utils.XmlUtil;

View File

@ -38,8 +38,6 @@ public class MediaServerItemLite {
private String secret; private String secret;
private int streamNoneReaderDelayMS;
private int hookAliveInterval; private int hookAliveInterval;
private int recordAssistPort; private int recordAssistPort;
@ -60,9 +58,7 @@ public class MediaServerItemLite {
this.rtspPort = mediaServerItem.getRtspPort(); this.rtspPort = mediaServerItem.getRtspPort();
this.rtspSSLPort = mediaServerItem.getRtspSSLPort(); this.rtspSSLPort = mediaServerItem.getRtspSSLPort();
this.secret = mediaServerItem.getSecret(); this.secret = mediaServerItem.getSecret();
this.streamNoneReaderDelayMS = mediaServerItem.getStreamNoneReaderDelayMS();
this.hookAliveInterval = mediaServerItem.getHookAliveInterval(); this.hookAliveInterval = mediaServerItem.getHookAliveInterval();
this.streamNoneReaderDelayMS = mediaServerItem.getStreamNoneReaderDelayMS();
this.recordAssistPort = mediaServerItem.getRecordAssistPort(); this.recordAssistPort = mediaServerItem.getRecordAssistPort();
} }
@ -171,14 +167,6 @@ public class MediaServerItemLite {
this.secret = secret; this.secret = secret;
} }
public int getStreamNoneReaderDelayMS() {
return streamNoneReaderDelayMS;
}
public void setStreamNoneReaderDelayMS(int streamNoneReaderDelayMS) {
this.streamNoneReaderDelayMS = streamNoneReaderDelayMS;
}
public int getHookAliveInterval() { public int getHookAliveInterval() {
return hookAliveInterval; return hookAliveInterval;
} }