Session error: 2003 when trying to connect using the video SDK sample app

We’re trying to using the sample app in the Video SDK 1.0.2. Using the JWTUtil.java class to generate the JWT token, and have fixed the 2 bugs that I found in other posts to add the tpc to the payload and the typ to the header. Here is the payload:

{“app_key”:“app-key-here”,“version”:1,“iat”:1620000507,“exp”:1620014907,“user_identity”:“test_Pixel 3a”,“tpc”:“test”}

and the header is:

{“alg”:“HS256”,“typ”:“JWT”}

We type test into the Session name and tap Create, it says Connecting… and then finally times out with “Session error: 2003”

Hi @carl1, thanks for using the dev forum.

Please note that I have moved your post over to the #mobile-video-sdk:android category. :slightly_smiling_face:

Can you please provide a code snippet showing how you are using the SDK to join the meeting? Also, is there a password on the session you are trying to join?

Thanks!

It’s the code in the sample app in the Video SDK, in zoom-instant-sdk-android-1.0.2\Sample&Libs\mobilertc-android.

No password.

Made a couple of bug fixes the JWTUtil.java without which it would not even get to the “Connecting…” message, updated gradle, and had to add a gradle.properties file with this, to get it to run on a Pixel 3a on Android 11:
android.useAndroidX=true

 +++ b/Sample&Libs/mobilertc-android/build.gradle
@@ -9,7 +9,7 @@ buildscript {
         google()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.3.0'
+        classpath 'com.android.tools.build:gradle:4.1.3'
     }
 }

diff --git a/Sample&Libs/mobilertc-android/gradle/wrapper/gradle-wrapper.properties b/Sample&Libs/mobilertc-android/gradle/wrapper/gradle-wrapper.properties
index 3614d73..db4ae96 100644
--- a/Sample&Libs/mobilertc-android/gradle/wrapper/gradle-wrapper.properties
+++ b/Sample&Libs/mobilertc-android/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Mon May 27 16:51:53 CST 2019
+#Sun May 02 15:02:49 PDT 2021
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip

     protected void init() {
diff --git a/Sample&Libs/mobilertc-android/sample/src/main/java/us/zoom/sdksample/Constants.java b/Sample&Libs/mobilertc-android/sample/src/main/java/us/zoom/sdksample/Constants.java
index 523f4c1..7229272 100644
--- a/Sample&Libs/mobilertc-android/sample/src/main/java/us/zoom/sdksample/Constants.java
+++ b/Sample&Libs/mobilertc-android/sample/src/main/java/us/zoom/sdksample/Constants.java
@@ -3,7 +3,7 @@ package us.zoom.sdksample;
 public interface Constants {

     // TODO Change it to your web domain
-    public final static String WEB_DOMAIN = "https://zoom.us";
+    public final static String WEB_DOMAIN = "https://villa.rocks";

     public final static String TOKEN = "";

diff --git a/Sample&Libs/mobilertc-android/sample/src/main/java/us/zoom/sdksample/util/JWTUtil.java b/Sample&Libs/mobilertc-android/sample/src/main/java/us/zoom/sdksample/util/JWTUtil.java
index fdda62e..a6bf5bb 100644
--- a/Sample&Libs/mobilertc-android/sample/src/main/java/us/zoom/sdksample/util/JWTUtil.java
+++ b/Sample&Libs/mobilertc-android/sample/src/main/java/us/zoom/sdksample/util/JWTUtil.java
@@ -24,9 +24,9 @@ public class JWTUtil {

     final static long EXPIRED_TIME = 3600 * 4;

-    private static final String apiKey = "";
+    private static final String apiKey = "our-api-key-goes-here";

-    private static final String apiSecret = "";
+    private static final String apiSecret = "our-api-secret-goes-here";
     //for sdk user to bind zoom id with app userId.
     public static String customIdentity="test_"+ Build.MODEL;

@@ -49,13 +49,14 @@ public class JWTUtil {
             payLoadObject.put("iat", iat);
             payLoadObject.put("exp", exp);
             payLoadObject.put("user_identity",customIdentity);
+            payLoadObject.put("tpc", "test");
         } catch (Exception e) {
             Log.e(TAG, e.toString());
         }

         try {
             headerObject.put("alg", "HS256");
-            payLoadObject.put("typ", "JWT");
+            headerObject.put("typ", "JWT");
         } catch (Exception e) {
             Log.e(TAG, e.toString());
         }

Hi @carl1,

Thanks for providing the diff. I have not been able to reproduce this locally. Could you provide the SDK logs so that we can investigate this further?

Thanks!

here you go: zoomlogs.zip - Google Drive

Hi @carl1,

Thanks for providing the logs. There are a couple of things in the logs that I’ll need to follow up with the team on. While I’m doing that, can you please confirm that you are providing a non-empty value for the userName field?

Thanks!

Yes it’s non-empty, tried using the one prefilled in the UI “Pixel 3a-30” and just “foo” with no special characters

Hi @carl1,

Thanks for confirming. Upon closer investigation, it appears that the SDK is timing out when trying to connect to the web service that manages session access. Since you are setting a custom domain, this is likely an issue with the domain being used.

Thanks!

Ok. It works if I change it back to the default value of https://zoom.us, but does not work if I change it to our web domain. I tried different variations with and without www. and app. prefixes. It simply doesn’t seem to connect unless I leave that value alone. What is it checking for exactly? Is this an account configuration? A web server configuration?

Hi @carl1,

Can you clarify what you are looking to accomplish by setting the domain to something other than the default value?

This domain determines where the SDK looks for a lot of different pieces of information, including from where the session is being managed. Specifically in the case of the error you are seeing, it is failing when trying to authenticate that the session is joinable based on the parameters provided in the network request (which is executed based off of the parameters provided in the session context object).

Thanks!