0

For example, if I have 20 conversations in my app that correspond to 20 different session Ids which I get from my app server.

Let's assume that the sessionIDs are 1 to 20.

Now can someone let me know how I will be notified if another user initiates a video call on conversation 15 (Session Id 15) so I can connect to same session and subscribe to the stream.

Manik
  • 1,495
  • 11
  • 19
Pankaj
  • 37
  • 7

2 Answers2

0

OpenTok QA staff here,

You can just connect to that sessionId, and listen for the onStreamCreated event. This event will be triggered when a publisher starts sending media to the session. Then, you can create a subscriber, and receive the stream.

Please, find more info and details here:

https://tokbox.com/developer/guides/publish-stream/js

https://tokbox.com/developer/guides/subscribe-stream/js/

0

TokBox Developer Evangelist here.

As Fran mentioned, you can connect to the session ID and listen to the streamCreated event to start subscribing. However, to know if someone is in the session without being present in the session, you can set up session monitoring which allows you to receive the following events through a callback on your server:

  • connectionCreated
  • connectionDestroyed
  • streamCreated
  • streamDestroyed

You can then use these events to connect to the appropriate session and start subscribing to the specific stream.

Manik
  • 1,495
  • 11
  • 19