Pre Merge pull request !20 from 7-Cool/wvp-28181-2.0

This commit is contained in:
7-Cool 2023-02-04 01:50:31 +00:00 committed by Gitee
commit c6a3da230a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -818,7 +818,14 @@ 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("m=video " + sendRtpItem.getLocalPort() + " 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()) {