兼容回复的invite 200OK消息中缺少ssrc(y字段)的情况

pull/1217/head
648540858 2023-12-15 22:44:41 +08:00
parent 0a245c4cfe
commit cb1f1417b6
1 changed files with 11 additions and 1 deletions

View File

@ -314,7 +314,13 @@ public class PlayServiceImpl implements IPlayService {
if (!device.getStreamMode().equalsIgnoreCase("TCP-ACTIVE")) { if (!device.getStreamMode().equalsIgnoreCase("TCP-ACTIVE")) {
return; return;
} }
String substring = contentString.substring(0, contentString.indexOf("y="));
String substring;
if (contentString.indexOf("y=") > 0) {
substring = contentString.substring(0, contentString.indexOf("y="));
}else {
substring = contentString;
}
try { try {
SessionDescription sdp = SdpFactory.getInstance().createSessionDescription(substring); SessionDescription sdp = SdpFactory.getInstance().createSessionDescription(substring);
int port = -1; int port = -1;
@ -568,6 +574,10 @@ public class PlayServiceImpl implements IPlayService {
ResponseEvent responseEvent = (ResponseEvent) eventResult.event; ResponseEvent responseEvent = (ResponseEvent) eventResult.event;
String contentString = new String(responseEvent.getResponse().getRawContent()); String contentString = new String(responseEvent.getResponse().getRawContent());
String ssrcInResponse = SipUtils.getSsrcFromSdp(contentString); String ssrcInResponse = SipUtils.getSsrcFromSdp(contentString);
// 兼容回复的消息中缺少ssrc(y字段)的情况
if (ssrcInResponse == null) {
ssrcInResponse = ssrcInfo.getSsrc();
}
if (ssrcInfo.getSsrc().equals(ssrcInResponse)) { if (ssrcInfo.getSsrc().equals(ssrcInResponse)) {
// ssrc 一致 // ssrc 一致
if (mediaServerItem.isRtpEnable()) { if (mediaServerItem.isRtpEnable()) {