本地GBStream流上级点播时,回复OK的SDP消息中本地端口采用随机数,兼容部分平台。

This commit is contained in:
lovemen 2023-01-18 16:43:42 +08:00
parent 5279481d90
commit b1bad9b6e5

View File

@ -827,7 +827,12 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
content.append("s=Play\r\n"); content.append("s=Play\r\n");
content.append("c=IN IP4 " + mediaServerItem.getSdpIp() + "\r\n"); content.append("c=IN IP4 " + mediaServerItem.getSdpIp() + "\r\n");
content.append("t=0 0\r\n"); content.append("t=0 0\r\n");
content.append("m=video " + sendRtpItem.getLocalPort() + " RTP/AVP 96\r\n"); int localPort = sendRtpItem.getLocalPort();
if (localPort == 0) {
// 非严格模式端口不统一, 增加兼容性修改为一个不为0的端口
localPort = new Random().nextInt(65535) + 1;
}
content.append("m=video " + localPort + " RTP/AVP 96\r\n");
content.append("a=sendonly\r\n"); content.append("a=sendonly\r\n");
content.append("a=rtpmap:96 PS/90000\r\n"); content.append("a=rtpmap:96 PS/90000\r\n");
if (sendRtpItem.isTcp()) { if (sendRtpItem.isTcp()) {