|
@@ -98,16 +98,24 @@ public class InviteResponseProcessor extends SIPResponseProcessorAbstract {
|
|
|
|
|
|
String contentString = new String(response.getRawContent());
|
|
|
// jainSip不支持y=字段, 移除以解析。
|
|
|
- int ssrcIndex = contentString.indexOf("y=");
|
|
|
+ int ssrcIndex = contentString.indexOf("y="),
|
|
|
+ fIndex = -1;
|
|
|
// 检查是否有y字段
|
|
|
SessionDescription sdp;
|
|
|
if (ssrcIndex >= 0) {
|
|
|
+ logger.info("[sdp优化] sdp_y 移除y字段 ");
|
|
|
//ssrc规定长度为10字节,不取余下长度以避免后续还有“f=”字段
|
|
|
- String substring = contentString.substring(0, contentString.indexOf("y="));
|
|
|
- sdp = SdpFactory.getInstance().createSessionDescription(substring);
|
|
|
- } else {
|
|
|
- sdp = SdpFactory.getInstance().createSessionDescription(contentString);
|
|
|
+ contentString = contentString.substring(0, contentString.indexOf("y="));
|
|
|
+ logger.debug("[sdp优化] sdp_y 多余内容移除 移除y字段: \n{}", contentString);
|
|
|
}
|
|
|
+ fIndex = contentString.indexOf("f=");
|
|
|
+ if(fIndex >= 0){
|
|
|
+ logger.info("[sdp优化] sdp_f 开始移除f字段");
|
|
|
+ contentString = contentString.substring(0, fIndex);
|
|
|
+ logger.debug("[sdp优化] sdp_f 移除f字段完成 : \n{}", contentString);
|
|
|
+ // 移除f字段
|
|
|
+ }
|
|
|
+ sdp = SdpFactory.getInstance().createSessionDescription(contentString);
|
|
|
|
|
|
SipURI requestUri = sipLayer.getSipFactory().createAddressFactory().createSipURI(sdp.getOrigin().getUsername(), event.getRemoteIpAddress() + ":" + event.getRemotePort());
|
|
|
Request reqAck = headerProvider.createAckRequest(response.getLocalAddress().getHostAddress(), requestUri, response);
|
|
@@ -117,6 +125,7 @@ public class InviteResponseProcessor extends SIPResponseProcessorAbstract {
|
|
|
}
|
|
|
} catch (InvalidArgumentException | ParseException | SipException | SdpParseException e) {
|
|
|
logger.info("[点播回复ACK],异常:", e );
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|