Bläddra i källkod

优化级联sdp消息

648540858 4 år sedan
förälder
incheckning
0787381e30

+ 1 - 1
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java

@@ -361,7 +361,7 @@ public class SIPCommander implements ISIPCommander {
 			//
 			StringBuffer content = new StringBuffer(200);
 			content.append("v=0\r\n");
-			content.append("o="+"00000"+" 0 0 IN IP4 "+ mediaServerItem.getSdpIp() +"\r\n");
+			content.append("o="+ sipConfig.getId()+" 0 0 IN IP4 "+ mediaServerItem.getSdpIp() +"\r\n");
 			content.append("s=Play\r\n");
 			content.append("c=IN IP4 "+ mediaServerItem.getSdpIp() +"\r\n");
 			content.append("t=0 0\r\n");

+ 2 - 2
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java

@@ -212,7 +212,7 @@ public class InviteRequestProcessor extends SIPRequestAbstractProcessor {
 
 						StringBuffer content = new StringBuffer(200);
 						content.append("v=0\r\n");
-						content.append("o="+"00000"+" 0 0 IN IP4 "+mediaServerItemInUSe.getSdpIp()+"\r\n");
+						content.append("o="+ channelId +" 0 0 IN IP4 "+mediaServerItemInUSe.getSdpIp()+"\r\n");
 						content.append("s=Play\r\n");
 						content.append("c=IN IP4 "+mediaServerItemInUSe.getSdpIp()+"\r\n");
 						content.append("t=0 0\r\n");
@@ -269,7 +269,7 @@ public class InviteRequestProcessor extends SIPRequestAbstractProcessor {
 					// TODO 添加对tcp的支持
 					StringBuffer content = new StringBuffer(200);
 					content.append("v=0\r\n");
-					content.append("o="+"00000"+" 0 0 IN IP4 "+mediaServerItem.getSdpIp()+"\r\n");
+					content.append("o="+ channelId +" 0 0 IN IP4 "+mediaServerItem.getSdpIp()+"\r\n");
 					content.append("s=Play\r\n");
 					content.append("c=IN IP4 "+mediaServerItem.getSdpIp()+"\r\n");
 					content.append("t=0 0\r\n");

+ 7 - 2
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java

@@ -107,8 +107,13 @@ public class ZLMRTPServerFactory {
         int currentPort = mediaServerItem.getCurrentPort();
         if (currentPort == 0) {
             String[] portRangeStrArray = mediaServerItem.getSendRtpPortRange().split(",");
-            portRangeArray[0] = Integer.parseInt(portRangeStrArray[0]);
-            portRangeArray[1] = Integer.parseInt(portRangeStrArray[1]);
+            if (portRangeStrArray.length != 2) {
+                portRangeArray[0] = 30000;
+                portRangeArray[1] = 30500;
+            }else {
+                portRangeArray[0] = Integer.parseInt(portRangeStrArray[0]);
+                portRangeArray[1] = Integer.parseInt(portRangeStrArray[1]);
+            }
         }
 
         if (currentPort == 0 || currentPort++ > portRangeArray[1]) {

+ 1 - 0
src/main/java/com/genersoft/iot/vmp/media/zlm/dto/MediaServerItem.java

@@ -89,6 +89,7 @@ public class MediaServerItem{
         streamNoneReaderDelayMS = zlmServerConfig.getGeneralStreamNoneReaderDelayMS();
         rtpEnable = false; // 默认使用单端口;直到用户自己设置开启多端口
         rtpPortRange = "30000,30500"; // 默认使用30000,30500作为级联时发送流的端口号
+        sendRtpPortRange = "30000,30500"; // 默认使用30000,30500作为级联时发送流的端口号
         recordAssistPort = 0; // 默认关闭
 
     }