Hello,
I use the openvidu-js-java tutorial + Openvidu deployed on premises, I am creating an Android app, I try to join a session using the OpenVidu Server RPC protocol.
When I create a session from Android, I receive this in the app server logs :
Getting a token from OpenVidu Server | {sessionName}={“sessionName”:“room123”,“userName”:“mike”}
New session room123
2020-07-19 12:45:08.409 INFO 9427 — [nio-5000-exec-4] io.openvidu.java.client.Session : Session ‘ses_OFHyOwg2Rq’ created
Here is the message that I send to join a session :
val obj = JSONObject()
obj.put("jsonrpc", 2.0)
obj.put("method", "joinRoom")
val objParams = JSONObject()
objParams.put("token", token)
objParams.put("session", roomName)
objParams.put("platform", "Android " + android.os.Build.VERSION.SDK_INT)
objParams.put("metadata", "{\"clientData\": \"$userName\"}")
objParams.put("secret", "")
objParams.put("recorder", false)
obj.put("params", objParams)
obj.put("id", 1)
I receive this error in Openvidu server :
openvidu-server_1 | [ERROR] 2020-07-19 10:45:10,750 [SessionHandler-a5l9fg3n1ut5lblvqgruui8djk-e24-t0] io.openvidu.server.rpc.RpcHandler - ERROR: Session room123 not found
openvidu-server_1 | [ERROR] 2020-07-19 10:45:10,750 [SessionHandler-a5l9fg3n1ut5lblvqgruui8djk-e24-t0] org.kurento.jsonrpc.internal.JsonRpcHandlerManager - Exception while processing request {“id”:1,“method”:“joinRoom”,“params”:{“token”:“wss://x.x.x.x:4443?sessionId=ses_OFHyOwg2Rq&token=tok_MS7ev5jiNEKtRsvh&role=PUBLISHER&version=2.15.0&coturnIp=x.x.x.x&turnUsername=ORVHVN&turnCredential=zcylyo”,“session”:“room123”,“platform”:“Android 23”,“metadata”:“{"clientData": "mike"}”,“secret”:“”,“recorder”:false},“jsonrpc”:“2.0”}
openvidu-server_1 | io.openvidu.client.OpenViduException: Unable to join session. Session room123 cannot be found. Code: 202
Here is what I receive in Android websocket :
{id=1.0, error={code=202.0, message=Unable to join session. Session room123 cannot be found. Code: 202}, jsonrpc=2.0}
I don’t understand why actually, can someone help me ?
Do I have to send the secret to join a room ?
roomName should be equal to “room123” or “ses_OFHyOwg2Rq” ?
Edit: it looks like roomName should be equal to “ses_OFHyOwg2Rq”
I will update this post to say if it works this way.