Browse Source

fix: 将 rtp over tcp / active 修改为 rtp over tcp / passive

wvp-28181-2.0 v2.2.1
fajiao 3 years ago
parent
commit
dc054dd2c9
  1. 25
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java

25
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java

@ -210,14 +210,15 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
// 区分TCP发流还是udp, 当前默认udp // 区分TCP发流还是udp, 当前默认udp
if ("TCP/RTP/AVP".equals(protocol)) { if ("TCP/RTP/AVP".equals(protocol)) {
mediaTransmissionTCP = true;
String setup = mediaDescription.getAttribute("setup"); String setup = mediaDescription.getAttribute("setup");
if (setup != null) { if (setup != null) {
mediaTransmissionTCP = true;
if ("active".equals(setup)) { if ("active".equals(setup)) {
tcpActive = true; // tcpActive = true;
// 不支持tcp主动 // // 不支持tcp主动
responseAck(evt, Response.NOT_IMPLEMENTED, "tcp active not support"); // 目录不支持点播 // responseAck(evt, Response.NOT_IMPLEMENTED, "tcp active not support"); // 目录不支持点播
return; // return;
tcpActive = false;
} else if ("passive".equals(setup)) { } else if ("passive".equals(setup)) {
tcpActive = false; tcpActive = false;
} }
@ -290,7 +291,11 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
}else { }else {
content.append("t=0 0\r\n"); content.append("t=0 0\r\n");
} }
if(sendRtpItem.isTcp()){
content.append("m=video "+ sendRtpItem.getLocalPort()+" TCP/RTP/AVP 96\r\n");
}else {
content.append("m=video "+ sendRtpItem.getLocalPort()+" 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");
content.append("y="+ ssrc + "\r\n"); content.append("y="+ ssrc + "\r\n");
@ -516,12 +521,16 @@ 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");
if(sendRtpItem.isTcp()){
content.append("m=video "+ sendRtpItem.getLocalPort()+" TCP/RTP/AVP 96\r\n");
}else {
content.append("m=video "+ sendRtpItem.getLocalPort()+" 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()) {
content.append("a=connection:new\r\n"); content.append("a=connection:new\r\n");
if (!sendRtpItem.isTcpActive()) { if (sendRtpItem.isTcpActive()) {
content.append("a=setup:active\r\n"); content.append("a=setup:active\r\n");
}else { }else {
content.append("a=setup:passive\r\n"); content.append("a=setup:passive\r\n");
@ -582,11 +591,11 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
String protocol = media.getProtocol(); String protocol = media.getProtocol();
// 区分TCP发流还是udp, 当前默认udp // 区分TCP发流还是udp, 当前默认udp
if ("TCP/RTP/AVP".equals(protocol)) { if ("TCP/RTP/AVP".equals(protocol)) {
mediaTransmissionTCP = true;
String setup = mediaDescription.getAttribute("setup"); String setup = mediaDescription.getAttribute("setup");
if (setup != null) { if (setup != null) {
mediaTransmissionTCP = true;
if ("active".equals(setup)) { if ("active".equals(setup)) {
tcpActive = true; tcpActive = false;
} else if ("passive".equals(setup)) { } else if ("passive".equals(setup)) {
tcpActive = false; tcpActive = false;
} }

Loading…
Cancel
Save