Commit 0787381e303553b3fc05d2bd07fcd404485f7016
1 parent
6dc4b8a7
优化级联sdp消息
Showing
4 changed files
with
11 additions
and
5 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
| ... | ... | @@ -361,7 +361,7 @@ public class SIPCommander implements ISIPCommander { |
| 361 | 361 | // |
| 362 | 362 | StringBuffer content = new StringBuffer(200); |
| 363 | 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 | 365 | content.append("s=Play\r\n"); |
| 366 | 366 | content.append("c=IN IP4 "+ mediaServerItem.getSdpIp() +"\r\n"); |
| 367 | 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 | 212 | |
| 213 | 213 | StringBuffer content = new StringBuffer(200); |
| 214 | 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 | 216 | content.append("s=Play\r\n"); |
| 217 | 217 | content.append("c=IN IP4 "+mediaServerItemInUSe.getSdpIp()+"\r\n"); |
| 218 | 218 | content.append("t=0 0\r\n"); |
| ... | ... | @@ -269,7 +269,7 @@ public class InviteRequestProcessor extends SIPRequestAbstractProcessor { |
| 269 | 269 | // TODO 添加对tcp的支持 |
| 270 | 270 | StringBuffer content = new StringBuffer(200); |
| 271 | 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 | 273 | content.append("s=Play\r\n"); |
| 274 | 274 | content.append("c=IN IP4 "+mediaServerItem.getSdpIp()+"\r\n"); |
| 275 | 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 | 107 | int currentPort = mediaServerItem.getCurrentPort(); |
| 108 | 108 | if (currentPort == 0) { |
| 109 | 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 | 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 | 89 | streamNoneReaderDelayMS = zlmServerConfig.getGeneralStreamNoneReaderDelayMS(); |
| 90 | 90 | rtpEnable = false; // 默认使用单端口;直到用户自己设置开启多端口 |
| 91 | 91 | rtpPortRange = "30000,30500"; // 默认使用30000,30500作为级联时发送流的端口号 |
| 92 | + sendRtpPortRange = "30000,30500"; // 默认使用30000,30500作为级联时发送流的端口号 | |
| 92 | 93 | recordAssistPort = 0; // 默认关闭 |
| 93 | 94 | |
| 94 | 95 | } | ... | ... |