修正平台Keepalive错误
parent
f840c85666
commit
b01ec1d727
|
@ -64,6 +64,7 @@ public class PlatformKeepaliveExpireEventLister implements ApplicationListener<P
|
||||||
// 有3次未收到心跳回复, 设置平台状态为离线, 开始重新注册
|
// 有3次未收到心跳回复, 设置平台状态为离线, 开始重新注册
|
||||||
logger.warn("有3次未收到心跳回复,标记设置平台状态为离线, 并重新注册 平台国标ID:" + event.getPlatformGbID());
|
logger.warn("有3次未收到心跳回复,标记设置平台状态为离线, 并重新注册 平台国标ID:" + event.getPlatformGbID());
|
||||||
publisher.platformNotRegisterEventPublish(event.getPlatformGbID());
|
publisher.platformNotRegisterEventPublish(event.getPlatformGbID());
|
||||||
|
parentPlatformCatch.setKeepAliveReply(0);
|
||||||
}else {
|
}else {
|
||||||
// 再次发送心跳
|
// 再次发送心跳
|
||||||
String callId = sipCommanderForPlatform.keepalive(parentPlatform);
|
String callId = sipCommanderForPlatform.keepalive(parentPlatform);
|
||||||
|
|
|
@ -154,6 +154,8 @@ public class SIPProcessorFactory {
|
||||||
} else if (Request.BYE.equals(method)) {
|
} else if (Request.BYE.equals(method)) {
|
||||||
ByeRequestProcessor processor = new ByeRequestProcessor();
|
ByeRequestProcessor processor = new ByeRequestProcessor();
|
||||||
processor.setRequestEvent(evt);
|
processor.setRequestEvent(evt);
|
||||||
|
processor.setRedisCatchStorage(redisCatchStorage);
|
||||||
|
processor.setZlmrtpServerFactory(zlmrtpServerFactory);
|
||||||
return processor;
|
return processor;
|
||||||
} else if (Request.CANCEL.equals(method)) {
|
} else if (Request.CANCEL.equals(method)) {
|
||||||
CancelRequestProcessor processor = new CancelRequestProcessor();
|
CancelRequestProcessor processor = new CancelRequestProcessor();
|
||||||
|
|
|
@ -118,18 +118,18 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
StringBuffer keepaliveXml = new StringBuffer(200);
|
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("<Notify>\r\n");
|
||||||
keepaliveXml.append("<CmdType>Keepalive</CmdType>\r\n");
|
keepaliveXml.append("<CmdType>Keepalive</CmdType>\r\n");
|
||||||
keepaliveXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\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("<Status>OK</Status>\r\n");
|
||||||
keepaliveXml.append("</Notify>\r\n");
|
keepaliveXml.append("</Notify>\r\n");
|
||||||
|
|
||||||
Request request = headerProviderPlarformProvider.createKeetpaliveMessageRequest(
|
Request request = headerProviderPlarformProvider.createKeetpaliveMessageRequest(
|
||||||
parentPlatform,
|
parentPlatform,
|
||||||
keepaliveXml.toString(),
|
keepaliveXml.toString(),
|
||||||
UUID.randomUUID().toString().replace("-", ""),
|
"z9hG4bK-" + UUID.randomUUID().toString().replace("-", ""),
|
||||||
UUID.randomUUID().toString().replace("-", ""),
|
UUID.randomUUID().toString().replace("-", ""),
|
||||||
null);
|
null);
|
||||||
transmitRequest(parentPlatform, request);
|
transmitRequest(parentPlatform, request);
|
||||||
|
|
Loading…
Reference in New Issue