void addKeepAlive(long delay) {
        if (idleTimer != null) return;
        idleTimer = new Timer();
        idleTimer.scheduleAtFixedRate(new TimerTask() {
            long lastTimeStamp = getTimestamp();

            @Override
            public void run() {
                if (lastTimeStamp == getTimestamp()) {
                    stopAgent();
                    return;
                }
                lastTimeStamp = getTimestamp();
            }
        }, delay, delay);
    }
Add a keep alive detector.
If the packet still more than the keep alive delay without receiving any packets. The Session is
stoped and remove from agents List.

@param delay delay time in millis to check if the channel is inactive
xmppserver/src/main/java/org/jivesoftware/openfire/mediaproxy/MediaProxySession.java