Vahid Kowsari
Vahid Kowsari

Reputation: 145

tokbox python api room creation

I am trying to use Tokbox for a multi-room chat, with each room having multiple routed sessions. We have developed the FE in angular to connect to our backend to retrieve a token that is generated by calling the tokbox python apis.

My questions: 1. How do implement 'rooms'. I dont see where I can pass parameters during session or token creation to pass a room?

  1. How do create a 'test' room, where the user can choose and verify his camera/microphone/speaker selection? Can we create a generic 'test' room?

Any help is much appreciated.

Thanks

Upvotes: 0

Views: 121

Answers (1)

Adam Ullman
Adam Ullman

Reputation: 1537

You can think of sessions like a room. Anyone that is in that room will see one another. There is no way to give a name to a room, but you can keep a mapping of room name to room in some kind of storage on your server.

I wouldn't recommend creating a test room that you reuse for everyone because you could end up with lots of people seeing one another when testing their devices. I would create a separate test session for each participant.

For an example of this you can look at the opentokdemo code. It's written in JavaScript (Node.js) unfortunately, not Python, but you can get an idea of how it works.

Here is where they create a new sessionId for doing a network test. They create a new sessionId for every participant for them to test in.

Here is where the logic is that tries to fetch the sessionId for a room name from persistent storage and if there is not one then it creates a new one and stores it.

Upvotes: 1

Related Questions