修复因为心跳重发导致的心跳间隔异常

This commit is contained in:
648540858 2023-07-14 09:10:59 +08:00
parent ef5018de2d
commit 4162706ec4

View File

@ -78,7 +78,9 @@ public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent imp
device.setKeepaliveIntervalTime(60);
}else {
long lastTime = DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(device.getKeepaliveTime());
device.setKeepaliveIntervalTime(new Long(System.currentTimeMillis()/1000-lastTime).intValue());
if (System.currentTimeMillis()/1000-lastTime > 10) {
device.setKeepaliveIntervalTime(new Long(System.currentTimeMillis()/1000-lastTime).intValue());
}
}
device.setKeepaliveTime(DateUtil.getNow());