jiang
2022-08-18 8f77d0c25cdd37d4cc96c923b46ae28607bae51d
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/KeepaliveNotifyMessageHandler.java
@@ -25,6 +25,9 @@
import javax.sip.message.Response;
import java.text.ParseException;
/**
 * 状态信息(心跳)报送
 */
@Component
public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent implements InitializingBean, IMessageHandler {
@@ -64,16 +67,14 @@
                device.setHostAddress(received.concat(":").concat(String.valueOf(rPort)));
            }
            device.setKeepaliveTime(DateUtil.getNow());
            // 回复200 OK
            responseAck(evt, Response.OK);
            if (device.getOnline() == 1) {
                // 回复200 OK
                responseAck(evt, Response.OK);
                deviceService.updateDevice(device);
            }else {
                // 对于已经离线的设备判断他的注册是否已经过期
                if (!deviceService.expire(device)){
                    deviceService.online(device);
                    // 回复200 OK
                    responseAck(evt, Response.OK);
                }
            }
        } catch (SipException e) {