Commit 31df0fb3ff3b8590a6c5ff304733fb8e1f6718ce
1 parent
55b15f8b
修复级联点播时tcp模式信令回复的错误
Showing
3 changed files
with
16 additions
and
3 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
| @@ -727,6 +727,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -727,6 +727,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 727 | if ( parentPlatform ==null) { | 727 | if ( parentPlatform ==null) { |
| 728 | return ; | 728 | return ; |
| 729 | } | 729 | } |
| 730 | + logger.info("[国标级联] 发送录像数据通道: {}", recordInfo.getChannelId()); | ||
| 730 | String characterSet = parentPlatform.getCharacterSet(); | 731 | String characterSet = parentPlatform.getCharacterSet(); |
| 731 | StringBuffer recordXml = new StringBuffer(600); | 732 | StringBuffer recordXml = new StringBuffer(600); |
| 732 | recordXml.append("<?xml version=\"1.0\" encoding=\"" + characterSet + "\"?>\r\n") | 733 | recordXml.append("<?xml version=\"1.0\" encoding=\"" + characterSet + "\"?>\r\n") |
| @@ -763,12 +764,14 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -763,12 +764,14 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 763 | 764 | ||
| 764 | recordXml.append("</RecordList>\r\n") | 765 | recordXml.append("</RecordList>\r\n") |
| 765 | .append("</Response>\r\n"); | 766 | .append("</Response>\r\n"); |
| 766 | - | 767 | + logger.info("[国标级联] 发送录像数据通道:{}, 内容: {}", recordInfo.getChannelId(), recordXml); |
| 767 | // callid | 768 | // callid |
| 768 | CallIdHeader callIdHeader = sipSender.getNewCallIdHeader(parentPlatform.getDeviceIp(),parentPlatform.getTransport()); | 769 | CallIdHeader callIdHeader = sipSender.getNewCallIdHeader(parentPlatform.getDeviceIp(),parentPlatform.getTransport()); |
| 769 | 770 | ||
| 770 | Request request = headerProviderPlatformProvider.createMessageRequest(parentPlatform, recordXml.toString(), fromTag, SipUtils.getNewViaTag(), callIdHeader); | 771 | Request request = headerProviderPlatformProvider.createMessageRequest(parentPlatform, recordXml.toString(), fromTag, SipUtils.getNewViaTag(), callIdHeader); |
| 771 | - sipSender.transmitRequest(parentPlatform.getDeviceIp(), request); | 772 | + sipSender.transmitRequest(parentPlatform.getDeviceIp(), request, null, eventResult -> { |
| 773 | + logger.info("[国标级联] 发送录像数据通道:{}, 发送成功", recordInfo.getChannelId()); | ||
| 774 | + }); | ||
| 772 | 775 | ||
| 773 | } | 776 | } |
| 774 | 777 |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
| @@ -396,7 +396,16 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements | @@ -396,7 +396,16 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements | ||
| 396 | // 非严格模式端口不统一, 增加兼容性,修改为一个不为0的端口 | 396 | // 非严格模式端口不统一, 增加兼容性,修改为一个不为0的端口 |
| 397 | localPort = new Random().nextInt(65535) + 1; | 397 | localPort = new Random().nextInt(65535) + 1; |
| 398 | } | 398 | } |
| 399 | - content.append("m=video " + localPort + " RTP/AVP 96\r\n"); | 399 | + if (sendRtpItem.isTcp()) { |
| 400 | + content.append("m=video " + localPort + " TCP/RTP/AVP 96\r\n"); | ||
| 401 | + if (!sendRtpItem.isTcpActive()) { | ||
| 402 | + content.append("a=setup:active\r\n"); | ||
| 403 | + } else { | ||
| 404 | + content.append("a=setup:passive\r\n"); | ||
| 405 | + } | ||
| 406 | + }else { | ||
| 407 | + content.append("m=video " + localPort + " RTP/AVP 96\r\n"); | ||
| 408 | + } | ||
| 400 | content.append("a=sendonly\r\n"); | 409 | content.append("a=sendonly\r\n"); |
| 401 | content.append("a=rtpmap:96 PS/90000\r\n"); | 410 | content.append("a=rtpmap:96 PS/90000\r\n"); |
| 402 | content.append("y=" + sendRtpItem.getSsrc() + "\r\n"); | 411 | content.append("y=" + sendRtpItem.getSsrc() + "\r\n"); |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/RecordInfoQueryMessageHandler.java
| @@ -102,6 +102,7 @@ public class RecordInfoQueryMessageHandler extends SIPRequestProcessorParent imp | @@ -102,6 +102,7 @@ public class RecordInfoQueryMessageHandler extends SIPRequestProcessorParent imp | ||
| 102 | // 接收录像数据 | 102 | // 接收录像数据 |
| 103 | recordEndEventListener.addEndEventHandler(deviceChannel.getDeviceId(), channelId, (recordInfo)->{ | 103 | recordEndEventListener.addEndEventHandler(deviceChannel.getDeviceId(), channelId, (recordInfo)->{ |
| 104 | try { | 104 | try { |
| 105 | + logger.info("[国标级联] 录像查询收到数据, 通道: {},准备转发===", channelId); | ||
| 105 | cmderFroPlatform.recordInfo(deviceChannel, parentPlatform, request.getFromTag(), recordInfo); | 106 | cmderFroPlatform.recordInfo(deviceChannel, parentPlatform, request.getFromTag(), recordInfo); |
| 106 | } catch (SipException | InvalidArgumentException | ParseException e) { | 107 | } catch (SipException | InvalidArgumentException | ParseException e) { |
| 107 | logger.error("[命令发送失败] 国标级联 回复录像数据: {}", e.getMessage()); | 108 | logger.error("[命令发送失败] 国标级联 回复录像数据: {}", e.getMessage()); |