How to join an existing session?

Description
I am able to create and join a session and use m_pInstantSDK to get info about the session (my username, id, etc.). I’d like to be able to join this same session from another app but cannot seem to do so. I am using the same developer credentials and session name to generate the JWT, but the second app seems to create an entirely different session rather than join the existing one.

Which Desktop Video SDK version?
zoom-instant-sdk-windows-1.0.2

Device:

  • OS: Windows 10

Additional context
The session does not currently require a password and both apps show “success” when running m_pInstantSDK->joinSession(sessionContext). I have confirmed that the second app is not joining the existing session by checking for the number of users in the session after the second app calls joinSession.

1 Like

Having the same issue. Two compilations of the app, same JWT, same session name, success on join for both but they are different instances. How do we join a session from two different instances of our apps?

Hey @kmelloy98,

Thanks for using the dev forum!

That is strange, the situation you described should indeed join the user into the ongoing session. Is there any change in behavior if you set the user name to be different between instances?

Thanks!
Michael

@Michael_Condon ,
I’ve been having this same problem and I’ve tried creating separate jwt tokens for each user by changing the username field of the payload json along with specifying different usernames in the sessionContext and separate sessions are still being created. Is there another place we need to specify the username?

@Michael_Condon thanks for responding. The user names are different between instances, but separate sessions are created. I have tried using the same JWT for both sessions and like @rhrdy I’ve also tried creating separate JWTs for each user.

Hi @Michael_Condon, @rhrdy and @kmelloy98 put our heads together offline on this one and we all happen to be doing the same thing. In our case, we are creating JWTs as described above, ensuring that usernames are different but session names are the same. We get success on the return, but unique sessions are created versus joined. Any ideas?

Hey Everyone,

That is disappointing. I will run some tests and see if I can re-produce, since this is happening to all of you this is probably not a mistake you are all making simultaneously :sweat_smile:. In the meantime, can you send your logs over from both the first instance of the SDK (where the session is created) and the second instance (where the session should’ve been joined instead of re-created).

Thanks,
Michael

We’ll get that together on our shared workshopping app and send it over to the support email. I think we’re all comfortable in disclosing the source code as well, because it really is just trying to join a session at this time.

1 Like

Hey @liminal_andy,

Sounds good. I just ran some tests, and saw a second user join the same session.
Here is my init code:

m_pInstantSDK = CreateZoomInstantSDKObj();
if (!m_pInstantSDK)
{
return;
}

//domain
ZoomInstantSDKInitParams initParams;
initParams.domain = L"https://zoom.us";
initParams.enableLog = true;
initParams.logFilePrefix = strLogPrefix.GetBuffer();
initParams.videoRawDataMemoryMode = ZoomInstantSDKRawDataMemoryModeHeap;
initParams.shareRawDataMemoryMode = ZoomInstantSDKRawDataMemoryModeHeap;
initParams.audioRawDataMemoryMode = ZoomInstantSDKRawDataMemoryModeHeap;
initParams.enableIndirectRawdata = false;

//init
int nRtn = m_pInstantSDK->initialize(initParams);
if (nRtn != ZoomInstantSDKErrors_Success)
{
return;
}
m_pInstantSDK->addListener(this);

Here is my joinSession code:

ZoomInstantSDKSessionContext sessionContext;
sessionContext.sessionName = L"test";
sessionContext.userName = L"mike";
sessionContext.token = L"mytoken";

IZoomInstantSDKSession* pSession = m_pInstantSDK->joinSession(sessionContex);
if (!pSession)
{
return;
}
else
{

}

Here was the payload I used:

  "app_key": "my key",
  "version": 1,
  "user_identity": "mike",
  "iat": 1617663242,
  "exp": 1617830386, 
  "tpc": "test"

When I ran this code on two separate machines I observed the onUserJoin callback triggered on the first machine when the second machine joined.

In your cases, are you seeing any of the callbacks being triggered?

Thanks,
Michael

Off the bat we did not see the callback and the list of users was 1, but let me scan over your code a few times to see if I spot the difference. Might go cross eyed, but clearly you have the solution here :slight_smile:

@liminal_andy @rhrdy @liminal_andy,

I looked at your code and I am curious when you are checking the number of participants in the session. To clarify, the return value of joinSession returns whether or not the call to joinSession was successful, however the callbacks are fired when the network request has completed and the user joined (or failed to join) the session. So a race condition is possible here if you are checking the session info right after the joinSession call. In your applications, are the callbacks firing? Specifically the onSessionJoin callback? If so, can you check the number of users within that callback instead of after the joinSession call?

Thanks
Michael

Hi Michael, I will let @rhrdy and @kmelloy98 give the full answer but it turns out that there were two issues at play, one being that the temporary web server was not returning the values in the proper format and the other being an issue in the event loop. We are now getting the callbacks!

1 Like

Hey @liminal_andy,

Oh awesome! That is good to hear! Are the sessions still being duplicated?

Thanks!
Michael

They no longer appear to be duplicating.

Hey @liminal_andy,

Whoo! Let me know if you run into anything else.

Thanks!
Michael

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.