Commit b01ec1d72738de24777aee67313539b50f98a15a
1 parent
f840c856
修正平台Keepalive错误
Showing
3 changed files
with
6 additions
and
3 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/event/platformKeepaliveExpire/PlatformKeepaliveExpireEventLister.java
| @@ -64,6 +64,7 @@ public class PlatformKeepaliveExpireEventLister implements ApplicationListener<P | @@ -64,6 +64,7 @@ public class PlatformKeepaliveExpireEventLister implements ApplicationListener<P | ||
| 64 | // 有3次未收到心跳回复, 设置平台状态为离线, 开始重新注册 | 64 | // 有3次未收到心跳回复, 设置平台状态为离线, 开始重新注册 |
| 65 | logger.warn("有3次未收到心跳回复,标记设置平台状态为离线, 并重新注册 平台国标ID:" + event.getPlatformGbID()); | 65 | logger.warn("有3次未收到心跳回复,标记设置平台状态为离线, 并重新注册 平台国标ID:" + event.getPlatformGbID()); |
| 66 | publisher.platformNotRegisterEventPublish(event.getPlatformGbID()); | 66 | publisher.platformNotRegisterEventPublish(event.getPlatformGbID()); |
| 67 | + parentPlatformCatch.setKeepAliveReply(0); | ||
| 67 | }else { | 68 | }else { |
| 68 | // 再次发送心跳 | 69 | // 再次发送心跳 |
| 69 | String callId = sipCommanderForPlatform.keepalive(parentPlatform); | 70 | String callId = sipCommanderForPlatform.keepalive(parentPlatform); |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorFactory.java
| @@ -154,6 +154,8 @@ public class SIPProcessorFactory { | @@ -154,6 +154,8 @@ public class SIPProcessorFactory { | ||
| 154 | } else if (Request.BYE.equals(method)) { | 154 | } else if (Request.BYE.equals(method)) { |
| 155 | ByeRequestProcessor processor = new ByeRequestProcessor(); | 155 | ByeRequestProcessor processor = new ByeRequestProcessor(); |
| 156 | processor.setRequestEvent(evt); | 156 | processor.setRequestEvent(evt); |
| 157 | + processor.setRedisCatchStorage(redisCatchStorage); | ||
| 158 | + processor.setZlmrtpServerFactory(zlmrtpServerFactory); | ||
| 157 | return processor; | 159 | return processor; |
| 158 | } else if (Request.CANCEL.equals(method)) { | 160 | } else if (Request.CANCEL.equals(method)) { |
| 159 | CancelRequestProcessor processor = new CancelRequestProcessor(); | 161 | CancelRequestProcessor processor = new CancelRequestProcessor(); |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
| @@ -118,18 +118,18 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -118,18 +118,18 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 118 | try { | 118 | try { |
| 119 | 119 | ||
| 120 | StringBuffer keepaliveXml = new StringBuffer(200); | 120 | StringBuffer keepaliveXml = new StringBuffer(200); |
| 121 | - keepaliveXml.append("<?xml version=\"1.0\" encoding=\"GB2312\" ?>\r\n"); | 121 | + keepaliveXml.append("<?xml version=\"1.0\"?>\r\n");//" encoding=\"GB2312\"?>\r\n"); |
| 122 | keepaliveXml.append("<Notify>\r\n"); | 122 | keepaliveXml.append("<Notify>\r\n"); |
| 123 | keepaliveXml.append("<CmdType>Keepalive</CmdType>\r\n"); | 123 | keepaliveXml.append("<CmdType>Keepalive</CmdType>\r\n"); |
| 124 | keepaliveXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n"); | 124 | keepaliveXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n"); |
| 125 | - keepaliveXml.append("<DeviceID>" + parentPlatform.getServerGBId() + "</DeviceID>\r\n"); | 125 | + keepaliveXml.append("<DeviceID>" + parentPlatform.getDeviceGBId() + "</DeviceID>\r\n"); |
| 126 | keepaliveXml.append("<Status>OK</Status>\r\n"); | 126 | keepaliveXml.append("<Status>OK</Status>\r\n"); |
| 127 | keepaliveXml.append("</Notify>\r\n"); | 127 | keepaliveXml.append("</Notify>\r\n"); |
| 128 | 128 | ||
| 129 | Request request = headerProviderPlarformProvider.createKeetpaliveMessageRequest( | 129 | Request request = headerProviderPlarformProvider.createKeetpaliveMessageRequest( |
| 130 | parentPlatform, | 130 | parentPlatform, |
| 131 | keepaliveXml.toString(), | 131 | keepaliveXml.toString(), |
| 132 | - UUID.randomUUID().toString().replace("-", ""), | 132 | + "z9hG4bK-" + UUID.randomUUID().toString().replace("-", ""), |
| 133 | UUID.randomUUID().toString().replace("-", ""), | 133 | UUID.randomUUID().toString().replace("-", ""), |
| 134 | null); | 134 | null); |
| 135 | transmitRequest(parentPlatform, request); | 135 | transmitRequest(parentPlatform, request); |