Commit 0787381e303553b3fc05d2bd07fcd404485f7016

Authored by 648540858
1 parent 6dc4b8a7

优化级联sdp消息

src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
@@ -361,7 +361,7 @@ public class SIPCommander implements ISIPCommander { @@ -361,7 +361,7 @@ public class SIPCommander implements ISIPCommander {
361 // 361 //
362 StringBuffer content = new StringBuffer(200); 362 StringBuffer content = new StringBuffer(200);
363 content.append("v=0\r\n"); 363 content.append("v=0\r\n");
364 - content.append("o="+"00000"+" 0 0 IN IP4 "+ mediaServerItem.getSdpIp() +"\r\n"); 364 + content.append("o="+ sipConfig.getId()+" 0 0 IN IP4 "+ mediaServerItem.getSdpIp() +"\r\n");
365 content.append("s=Play\r\n"); 365 content.append("s=Play\r\n");
366 content.append("c=IN IP4 "+ mediaServerItem.getSdpIp() +"\r\n"); 366 content.append("c=IN IP4 "+ mediaServerItem.getSdpIp() +"\r\n");
367 content.append("t=0 0\r\n"); 367 content.append("t=0 0\r\n");
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java
@@ -212,7 +212,7 @@ public class InviteRequestProcessor extends SIPRequestAbstractProcessor { @@ -212,7 +212,7 @@ public class InviteRequestProcessor extends SIPRequestAbstractProcessor {
212 212
213 StringBuffer content = new StringBuffer(200); 213 StringBuffer content = new StringBuffer(200);
214 content.append("v=0\r\n"); 214 content.append("v=0\r\n");
215 - content.append("o="+"00000"+" 0 0 IN IP4 "+mediaServerItemInUSe.getSdpIp()+"\r\n"); 215 + content.append("o="+ channelId +" 0 0 IN IP4 "+mediaServerItemInUSe.getSdpIp()+"\r\n");
216 content.append("s=Play\r\n"); 216 content.append("s=Play\r\n");
217 content.append("c=IN IP4 "+mediaServerItemInUSe.getSdpIp()+"\r\n"); 217 content.append("c=IN IP4 "+mediaServerItemInUSe.getSdpIp()+"\r\n");
218 content.append("t=0 0\r\n"); 218 content.append("t=0 0\r\n");
@@ -269,7 +269,7 @@ public class InviteRequestProcessor extends SIPRequestAbstractProcessor { @@ -269,7 +269,7 @@ public class InviteRequestProcessor extends SIPRequestAbstractProcessor {
269 // TODO 添加对tcp的支持 269 // TODO 添加对tcp的支持
270 StringBuffer content = new StringBuffer(200); 270 StringBuffer content = new StringBuffer(200);
271 content.append("v=0\r\n"); 271 content.append("v=0\r\n");
272 - content.append("o="+"00000"+" 0 0 IN IP4 "+mediaServerItem.getSdpIp()+"\r\n"); 272 + content.append("o="+ channelId +" 0 0 IN IP4 "+mediaServerItem.getSdpIp()+"\r\n");
273 content.append("s=Play\r\n"); 273 content.append("s=Play\r\n");
274 content.append("c=IN IP4 "+mediaServerItem.getSdpIp()+"\r\n"); 274 content.append("c=IN IP4 "+mediaServerItem.getSdpIp()+"\r\n");
275 content.append("t=0 0\r\n"); 275 content.append("t=0 0\r\n");
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
@@ -107,8 +107,13 @@ public class ZLMRTPServerFactory { @@ -107,8 +107,13 @@ public class ZLMRTPServerFactory {
107 int currentPort = mediaServerItem.getCurrentPort(); 107 int currentPort = mediaServerItem.getCurrentPort();
108 if (currentPort == 0) { 108 if (currentPort == 0) {
109 String[] portRangeStrArray = mediaServerItem.getSendRtpPortRange().split(","); 109 String[] portRangeStrArray = mediaServerItem.getSendRtpPortRange().split(",");
110 - portRangeArray[0] = Integer.parseInt(portRangeStrArray[0]);  
111 - portRangeArray[1] = Integer.parseInt(portRangeStrArray[1]); 110 + if (portRangeStrArray.length != 2) {
  111 + portRangeArray[0] = 30000;
  112 + portRangeArray[1] = 30500;
  113 + }else {
  114 + portRangeArray[0] = Integer.parseInt(portRangeStrArray[0]);
  115 + portRangeArray[1] = Integer.parseInt(portRangeStrArray[1]);
  116 + }
112 } 117 }
113 118
114 if (currentPort == 0 || currentPort++ > portRangeArray[1]) { 119 if (currentPort == 0 || currentPort++ > portRangeArray[1]) {
src/main/java/com/genersoft/iot/vmp/media/zlm/dto/MediaServerItem.java
@@ -89,6 +89,7 @@ public class MediaServerItem{ @@ -89,6 +89,7 @@ public class MediaServerItem{
89 streamNoneReaderDelayMS = zlmServerConfig.getGeneralStreamNoneReaderDelayMS(); 89 streamNoneReaderDelayMS = zlmServerConfig.getGeneralStreamNoneReaderDelayMS();
90 rtpEnable = false; // 默认使用单端口;直到用户自己设置开启多端口 90 rtpEnable = false; // 默认使用单端口;直到用户自己设置开启多端口
91 rtpPortRange = "30000,30500"; // 默认使用30000,30500作为级联时发送流的端口号 91 rtpPortRange = "30000,30500"; // 默认使用30000,30500作为级联时发送流的端口号
  92 + sendRtpPortRange = "30000,30500"; // 默认使用30000,30500作为级联时发送流的端口号
92 recordAssistPort = 0; // 默认关闭 93 recordAssistPort = 0; // 默认关闭
93 94
94 } 95 }