Table of Contents

onWrtcCmd()

wrtc.onWrtcCmd() is an event function called when user command has been received through RTCgate signaling channel.

You can use this event to take care of the incoming user command.

Arguments

wrtc.onWrtcCmd(obj, msg)

Return value

Ignored.

Example

If sending client has sent {cmd: "ping"} using

call.adv.sendWrtcCmd({cmd: "ping"});

you will receive a wrtc.onWrtcCmd() call with {cmd: "ping"} in its msg.cmd argument. Then you can respond with {cmd: "pong"}:

  wrtc.onWrtcCmd= function(obj, msg) {
    if ((msg.cmd.cmd) && (msg.cmd.cmd == "ping"))
      if (obj.objType == "call")
        obj.adv.sendWrtcCmd({cmd: "pong"});
      else
        wrtc.adv.sendWrtcCmd(msg.from, {cmd: "pong"});
  }

See also

wrtc.adv.sendWrtcCmd()

call.adv.sendWrtcCmd()