0

I would like to discuss my situation and understanding.

We need callers to video call customers. For this, I've been using Tokbox video chat.

I have setup a server for authentication purpose. It creates singleton session and generate tokens as given in the example code.

This is what I have in my mind till now

  1. If callers A and B want to call customers C1 and C2, I guess I need to create two different sessions and their separate tokens.

  2. I need to store session id and tokens for A and B separately in database or session

  3. I need to send the session id and token to client mobile app so that client can subscribe

I don't need code, but just want to know if I'm going in right direction. If a similar type of example links are available, that would be great

Thanks

Lucas Huang
  • 3,998
  • 3
  • 20
  • 29
Ashutosh
  • 4,371
  • 10
  • 59
  • 105

2 Answers2

1

Yes, I believe you're correct.

You can think of sessions like rooms, anyone whom joins the session (or room) can see and talk to each other.

Tokens can be thought of as keys to the room. If you have a token to the session, or a key to the room, then you're able to gain access.

You'll need to generate these sessionIds and tokens on a server, and store them in some sort of database. When caller A calls customer C1 a new sessionId will be generated. Then you'll need to generate a token for A and C1. They can now talk to each other. It's up to you to ensure that only A and C1 have access to the sessionId and tokens (using some sort of authentication and authorisation system).

Michael Leaney
  • 753
  • 4
  • 10
1

I know the answer is too late but may help someone. I think you need not to store anything in database, so in your case, you are calling from web to mobile. I have implemented the same for my project. So the approach I am following is that I am creating an opentok Session and sending it to Mobile app using FCM, and connect on both web and Mobile. Once connection is established, We can start the actual Video chat. Since we are using FCM, we have mobile device Id, so we are sure that we are sending it to User it is intended for ( thus doing authentication as well)

Suhail Mushtaq
  • 81
  • 1
  • 2
  • 11