-- -- Add a timeout source if idle for at least 5 seconds
-- if new_state == "idle" or new_state == "error" then
-- honor "session.suspend-timeout-seconds" if specified
-- local timeout =
-- tonumber(node.properties["session.suspend-timeout-seconds"]) or 5
-- if timeout == 0 then
-- return
-- end
-- add idle timeout; multiply by 1000, timeout_add() expects ms
-- sources[id] = Core.timeout_add(timeout * 1000, function()
-- Suspend the node
-- but check first if the node still exists
-- if (node:get_active_features() & Feature.Proxy.BOUND) ~= 0 then
-- log:info(node, "was idle for a while; suspending ...")
-- node:send_command("Suspend")
-- end
-- Unref the source
-- sources[id] = nil
-- false (== G_SOURCE_REMOVE) destroys the source so that this
-- function does not get fired again after 5 seconds
-- return false
-- end)