修正平台Keepalive错误

This commit is contained in:
lawrencehj 2021-03-10 14:37:17 +08:00
parent 8063172e09
commit 6d20f7dd9a
3 changed files with 6 additions and 3 deletions

View File

@ -64,6 +64,7 @@ public class PlatformKeepaliveExpireEventLister implements ApplicationListener<P
// 有3次未收到心跳回复, 设置平台状态为离线, 开始重新注册
logger.warn("有3次未收到心跳回复,标记设置平台状态为离线, 并重新注册 平台国标ID" + event.getPlatformGbID());
publisher.platformNotRegisterEventPublish(event.getPlatformGbID());
parentPlatformCatch.setKeepAliveReply(0);
}else {
// 再次发送心跳
String callId = sipCommanderForPlatform.keepalive(parentPlatform);

View File

@ -154,6 +154,8 @@ public class SIPProcessorFactory {
} else if (Request.BYE.equals(method)) {
ByeRequestProcessor processor = new ByeRequestProcessor();
processor.setRequestEvent(evt);
processor.setRedisCatchStorage(redisCatchStorage);
processor.setZlmrtpServerFactory(zlmrtpServerFactory);
return processor;
} else if (Request.CANCEL.equals(method)) {
CancelRequestProcessor processor = new CancelRequestProcessor();

View File

@ -118,18 +118,18 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
try {
StringBuffer keepaliveXml = new StringBuffer(200);
keepaliveXml.append("<?xml version=\"1.0\" encoding=\"GB2312\" ?>\r\n");
keepaliveXml.append("<?xml version=\"1.0\"?>\r\n");//" encoding=\"GB2312\"?>\r\n");
keepaliveXml.append("<Notify>\r\n");
keepaliveXml.append("<CmdType>Keepalive</CmdType>\r\n");
keepaliveXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
keepaliveXml.append("<DeviceID>" + parentPlatform.getServerGBId() + "</DeviceID>\r\n");
keepaliveXml.append("<DeviceID>" + parentPlatform.getDeviceGBId() + "</DeviceID>\r\n");
keepaliveXml.append("<Status>OK</Status>\r\n");
keepaliveXml.append("</Notify>\r\n");
Request request = headerProviderPlarformProvider.createKeetpaliveMessageRequest(
parentPlatform,
keepaliveXml.toString(),
UUID.randomUUID().toString().replace("-", ""),
"z9hG4bK-" + UUID.randomUUID().toString().replace("-", ""),
UUID.randomUUID().toString().replace("-", ""),
null);
transmitRequest(parentPlatform, request);