OpenSight / janus-cloud

a cluster solution for Janus WebRTC server, by API proxy approach
GNU Affero General Public License v3.0
205 stars 49 forks source link

Unable to join a room using janus-proxy - Error Invalid element type (id should be a string) #30

Closed muthuaravind closed 2 years ago

muthuaravind commented 2 years ago

{"videoroom":"event","error_code":430,"error":"Invalid element type (id should be a string)","traceback":[" File "/usr/local/lib/python3.6/dist-packages/januscloud/proxy/plugin/videoroom.py", line 2391, in _handle_async_message\n new_publisher.connect_backend(backend_server)\n"," File "/usr/local/lib/python3.6/dist-packages/januscloud/proxy/plugin/videoroom.py", line 786, in connect_backend\n _send_backend_message(backend_handle, body)\n"," File "/usr/local/lib/python3.6/dist-packages/januscloud/proxy/plugin/videoroom.py", line 279, in _send_backend_message\n data.get('error_code', JANUS_VIDEOROOM_ERROR_UNKNOWN_ERROR))\n"]} on session 852580733184344

muthuaravind commented 2 years ago

any updates on this please @jamken

muthuaravind commented 2 years ago

Hi @jamken

jamken commented 2 years ago

Hi, @muthuaravind please provide all infomation of this join request (with all params)

jamken commented 2 years ago

from your message, this error is report by the backend janus server.

muthuaravind commented 2 years ago

websocket onMessage: {

   "janus": "event",
   "session_id": 852580733184344,
   "transaction": "ABP4dAvDU3wB",
   "plugindata": {
      "plugin": "janus.plugin.videoroom",
      "data": {
         "videoroom": "event",
         "error_code": 430,
         "error": "Invalid element type (id should be a string)",
         "traceback": [
            "  File \"/usr/local/lib/python3.6/dist-packages/januscloud/proxy/plugin/videoroom.py\", line 2391, in _handle_async_message\n    new_publisher.connect_backend(backend_server)\n",
            "  File \"/usr/local/lib/python3.6/dist-packages/januscloud/proxy/plugin/videoroom.py\", line 786, in connect_backend\n    _send_backend_message(backend_handle, body)\n",
            "  File \"/usr/local/lib/python3.6/dist-packages/januscloud/proxy/plugin/videoroom.py\", line 279, in _send_backend_message\n    data.get('error_code', JANUS_VIDEOROOM_ERROR_UNKNOWN_ERROR))\n"
         ]
      }
   },
   "sender": 8132604522424994
}

sendToWebSocketServer: {"janus":"message","body":{"request":"join","ptype":"publisher","room":"1969351866050470","display":"iiogjjzdwb@xmpp-sandbox-dev.mirrorfly.com"},"transaction":"E12raCubh9iJ","session_id":7016472636757720,"handle_id":8609270613755311}

{"janus":"success","session_id":5430718456946130,"transaction":"lFclmWWU72sb","sender":4959417055826980,"plugindata":{"plugin":"janus.plugin.videoroom","data":{"videoroom":"event","error_code":427,"error":"Room 1234 already exists","traceback":[" File \"\/usr\/local\/lib\/python3.6\/dist-packages\/januscloud\/proxy\/plugin\/videoroom.py\", line 2039, in handle_message\n result = self._handle_sync_message(transaction, body, jsep)\n"," File \"\/usr\/local\/lib\/python3.6\/dist-packages\/januscloud\/proxy\/plugin\/videoroom.py\", line 2097, in _handle_sync_message\n room_params=room_params)\n"," File \"\/usr\/local\/lib\/python3.6\/dist-packages\/januscloud\/proxy\/plugin\/videoroom.py\", line 1697, in create\n JANUS_VIDEOROOM_ERROR_ROOM_EXISTS)\n"]}}}

jamken commented 2 years ago

Hi, @muthuaravind

It seams like you use the string IDs feature of the backend janus-gateway which is not supported by Janus-cloud. please check the configuration file of the videoroom pluagin of the backend janus-gateway, which looks like below:

general: {
    #admin_key = "supersecret"      # If set, rooms can be created via API only
                                    # if this key is provided in the request
    #lock_rtp_forward = true        # Whether the admin_key above should be
                                    # enforced for RTP forwarding requests too
    #events = false                 # Whether events should be sent to event
                                    # handlers (default=true)

    # By default, integers are used as a unique ID for both rooms and participants.
    # In case you want to use strings instead (e.g., a UUID), set string_ids to true.
    #string_ids = false            ********************** important: must set to false
}
muthuaravind commented 2 years ago

Thanks @jamken now able to create the room