From b1bad9b6e517089cf70bad007f70d2762f8c4304 Mon Sep 17 00:00:00 2001 From: lovemen <50255147@qq.com> Date: Wed, 18 Jan 2023 16:43:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E5=9C=B0GBStream=E6=B5=81=E4=B8=8A?= =?UTF-8?q?=E7=BA=A7=E7=82=B9=E6=92=AD=E6=97=B6=EF=BC=8C=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?OK=E7=9A=84SDP=E6=B6=88=E6=81=AF=E4=B8=AD=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E7=AB=AF=E5=8F=A3=E9=87=87=E7=94=A8=E9=9A=8F=E6=9C=BA=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E5=85=BC=E5=AE=B9=E9=83=A8=E5=88=86=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event/request/impl/InviteRequestProcessor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java index 384756d27..f766c0b14 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java @@ -827,7 +827,12 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements content.append("s=Play\r\n"); content.append("c=IN IP4 " + mediaServerItem.getSdpIp() + "\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=rtpmap:96 PS/90000\r\n"); if (sendRtpItem.isTcp()) {