Where can I catch response from Janus WebRTC server after send synchronous message

1.2k views Asked by At

After attaching videoroom plugin to Janus, in "success" callback i send synchronous message to it

janus.attach(
    {           
        plugin: "janus.plugin.videoroom",
        opaqueId: opaqueId,
        success: function(pluginHandle) {
            roomMaster = pluginHandle;
            var isExist = {
                "request" : "exists",
                "room" : myroom
            };

            roomMaster.send({"message": isExist})
        },

and get response in console from janus.js, but in documentation tells that plugin will send to me response message. And I can't understand - where i can catch it?

onmessage: function(msg, jsep){

    // is fired only after sending async requests like "join", "start" - not "exists"
    conslole.log(msg);  
}

Anybody know?

Thank you

1

There are 1 answers

0
RockingChair On BEST ANSWER

You can define a success callback in the request object:

  roomHandle.send({ 
    "message" : {
      request : 'list'
    },
    success: function(result) {
      console.log(result);
    }      
  });