adv.sendWrtcCmd()
wrtc.adv.sendWrtcCmd() is used to transmit data to remote user using RTCgate signaling channel.
It is intended to send small amounts of user commands and arguments to a remote client. For large amounts of data use data channel instead.
Arguments
wrtc.adv.sendWrtcCmd(to, data)
- to - string containing addressName of recepient to send data to.
- data - string or JSON data containing user command to send.
Returns
Nothing.
Will trigger wrtc.onWrtcCmd() at receiving end.
Usage
Please understand that wrtc.adv.sendWrtcCmd() may fail to deliver commands to remote clients connected to remote webrtc servers. There is no feedback on failure.
If you are currently in call with the recepient then you should use call.adv.sendWrtcCmd() instead of wrtc.adv.sendWrtcCmd() to allow RTCgate use any SIP connections already made. This increases the reliability of the transfer.
Example
wrtc.adv.sendWrtcCmd("johndoe", {cmd:"yourcmd", data:"yourdata"});