修复级联推流时本地端口设置错误
parent
ce8e743811
commit
574bad047c
|
@ -665,19 +665,21 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
|||
* 安排推流
|
||||
*/
|
||||
private void sendProxyStream(SendRtpItem sendRtpItem, MediaServerItem mediaServerItem, ParentPlatform platform, SIPRequest request) {
|
||||
Boolean streamReady = zlmServerFactory.isStreamReady(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStream());
|
||||
if (streamReady != null && streamReady) {
|
||||
// 自平台内容
|
||||
int localPort = sendRtpPortManager.getNextPort(mediaServerItem);
|
||||
if (localPort == 0) {
|
||||
logger.warn("服务器端口资源不足");
|
||||
try {
|
||||
responseAck(request, Response.BUSY_HERE);
|
||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
||||
logger.error("[命令发送失败] invite 服务器端口资源不足: {}", e.getMessage());
|
||||
}
|
||||
return;
|
||||
Boolean streamReady = zlmServerFactory.isStreamReady(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStream());
|
||||
if (streamReady != null && streamReady) {
|
||||
// 自平台内容
|
||||
int localPort = sendRtpPortManager.getNextPort(mediaServerItem);
|
||||
if (localPort == 0) {
|
||||
logger.warn("服务器端口资源不足");
|
||||
try {
|
||||
responseAck(request, Response.BUSY_HERE);
|
||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
||||
logger.error("[命令发送失败] invite 服务器端口资源不足: {}", e.getMessage());
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
sendRtpItem.setLocalPort(localPort);
|
||||
sendRtpItem.setPlayType(InviteStreamType.PROXY);
|
||||
// 写入redis, 超时时回复
|
||||
sendRtpItem.setStatus(1);
|
||||
|
@ -707,6 +709,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
|||
}
|
||||
return;
|
||||
}
|
||||
sendRtpItem.setLocalPort(localPort);
|
||||
// 写入redis, 超时时回复
|
||||
sendRtpItem.setStatus(1);
|
||||
SIPResponse response = sendStreamAck(request, sendRtpItem, platform);
|
||||
|
|
|
@ -92,6 +92,7 @@ public class RedisRpcController {
|
|||
if (mediaServerItem == null) {
|
||||
RedisRpcResponse response = request.getResponse();
|
||||
response.setStatusCode(200);
|
||||
return response;
|
||||
}
|
||||
// 自平台内容
|
||||
int localPort = sendRtpPortManager.getNextPort(mediaServerItem);
|
||||
|
@ -99,9 +100,11 @@ public class RedisRpcController {
|
|||
logger.info("[redis-rpc] getSendRtpItem->服务器端口资源不足" );
|
||||
RedisRpcResponse response = request.getResponse();
|
||||
response.setStatusCode(200);
|
||||
return response;
|
||||
}
|
||||
// 写入redis, 超时时回复
|
||||
sendRtpItem.setStatus(1);
|
||||
sendRtpItem.setLocalPort(localPort);
|
||||
sendRtpItem.setServerId(userSetting.getServerId());
|
||||
sendRtpItem.setLocalIp(mediaServerItem.getSdpIp());
|
||||
if (sendRtpItem.getSsrc() == null) {
|
||||
|
|
Loading…
Reference in New Issue