0

Bless To all I am developing an application in which i am implementing instant Messaging,Voip audio call and video call through using opentok/tokbox.I read all documentation it was though easy but not very much.But i am confusing at a point.Lets suppose if i have three user in my android application say A,B,C. if user A wants to message with user B then how user B will know that he have to receive message from that session that is assigned to user A?how user A will send message that will go directly to user B. Hope you all understand the question.Would like to hear any suggestion from you.and if anyone worked other plateform for these 3 features(instant messaging,voip audio,video) for free or trial.Please let me know also. Thanks in advance

2 Answers2

0

Your server will need to coordinate users and sessions using logic that you implement yourself. This will vary greatly depending on the server side language you use and the type of application you're creating.

Based on your example, your server side implementation needs to pair user A and user B together and give both users the same session ID so when they initialise and connect to that session, they can see each other.

If you've already read all the guides found at https://tokbox.com/developer/guides/ then make sure you also take a look at the sample applications https://tokbox.com/developer/samples/ They don't match your use case exactly but demonstrate how to create a 'room' that both users can visit to retrieve the same session ID.

aiham
  • 3,614
  • 28
  • 32
0

The way opentok Sessions are structured is more like a conference call than a direct phone call which is what makes it confusing. But it's still possible to get the behaviour of a phone call. There are a couple of different ways you can do this.

  1. You can create a session for every user. Then if user A wants to message user B, they connect to User B's session and send a signal. This requires you to keep track of which sessionId applies to each user.
  2. Everyone is connected to the same giant session. When user A wants to message user B they send a signal to user B's connectionId. You can use the connection data property to put eg. usernames in the connections to help you keep track.
  3. You can use a 3rd party service for messaging and just use OpenTok for the audio/video part.

Hope that helps.

Adam Ullman
  • 1,517
  • 7
  • 12