I'm trying to terminate all Tokbox connections from server-side. I have the logic the terminate connections from client-side, however, clients are unreliable that it may not get to disconnect properly(network issue, sudden app termination etc).
I'm aware of the forceDisconnect
option with a connectionId
either from the SDK or REST API. However, I can't find an option to list all open connections from a sessionId from server side.
I'm also aware that, I can just wait for sessions to expire. (How to disconnect all connection on a session?)
However, waiting for the tokens to expire(or the session to terminate on Tokbox Server side), costs much more, especially if you are using auto-archiving option. If you don't explicitly terminate your sessions, you'll get billed for your session + up to 1 hour of archiving.
In summary, when a tokbox session is over, what I want to do is
Clients will try to disconnect their own connections(Done)
If clients, for some reason, fail to do #1, server will list all active connections.
call
forceDisconnect
on each connections from #2