Leaving a session open when participants have all left

I noticed that as soon as a session has a token requested, and all participants have left, the session is immediately destroyed. I would like to keep this session open for a period of time to allow people to reconnect.

Our use case is one-on-one classes with only 2 participants. If both disconnect, then reconnect 30 seconds later, the old session is already gone.

I see that this could be worked around by recreating a session with the same name. However, this would not solve the problem that recordings would stop, and you would end up with two separate recordings.

Is there a way to ensure a session will not be destroyed immediately?

If a session is being recorded, it won’t be automatically closed when last participant leaves it. You can adjust the time the recording will take to be stopped and the session to be destroyed with parameter OPENVIDU_RECORDING_AUTOSTOP_TIMEOUT. See this parameter at https://docs.openvidu.io/en/latest/reference-docs/openvidu-config/ and the automatic recording stop behavior here: https://docs.openvidu.io/en/latest/advanced-features/recording/#automatic-stop-of-recordings