mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-27 15:37:50 +08:00
Pre Merge pull request !15 from 小飞/wvp-28181-2.0
This commit is contained in:
commit
ae7b25e707
@ -5,6 +5,7 @@ import com.genersoft.iot.vmp.conf.DynamicTask;
|
|||||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
|
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.session.SsrcConfig;
|
||||||
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
|
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.SIPSender;
|
import com.genersoft.iot.vmp.gb28181.transmit.SIPSender;
|
||||||
@ -252,7 +253,15 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
|||||||
String substring = contentString.substring(0, contentString.indexOf("y="));
|
String substring = contentString.substring(0, contentString.indexOf("y="));
|
||||||
sdp = SdpFactory.getInstance().createSessionDescription(substring);
|
sdp = SdpFactory.getInstance().createSessionDescription(substring);
|
||||||
} else {
|
} else {
|
||||||
|
if(mediaServerItem!=null)
|
||||||
|
{
|
||||||
|
SsrcConfig ssrcConfig = mediaServerItem.getSsrcConfig();
|
||||||
|
ssrc = ssrcConfig.getPlaySsrc();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
ssrc = ssrcDefault;
|
ssrc = ssrcDefault;
|
||||||
|
}
|
||||||
sdp = SdpFactory.getInstance().createSessionDescription(contentString);
|
sdp = SdpFactory.getInstance().createSessionDescription(contentString);
|
||||||
}
|
}
|
||||||
String sessionName = sdp.getSessionName().getValue();
|
String sessionName = sdp.getSessionName().getValue();
|
||||||
@ -818,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()) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user