call()
wrtc.call() places a call to the remote user supplied as argument, eg wrtc.call("foo@bar.com") calls foo@bar.com
If the argument is an address to a user connected to the same IXNX unit the call may be connected using webRTC and RTCgate.
If the argument is a SIP address of a user not connected to the IXNX unit the call will be automatically converted to a SIP call by the IXNX unit.
The optional config argument can be used to configure aspects of the created call.
Arguments
wrtc.call(address, config)
- address - string containing the address of user to call
- config - (optional) JSON structure containing configuration of the created call:
- callGroup - (optional) boolean: true if you want this call to be added to ongoing group call. If false or missing call will be a separate, single call.
- clientID - (optional) clientID of user to call
- clientGRUU - (optional) SIP GRUU of user to call
- remoteVideo - (optional) HTML <video> object that will display received video stream
- sendVideo - (optional) boolean: if true or missing your video stream will be transmitted. If false no video (only audio) will be transmitted.
- addDataChannel - (optional) include a data channel into the connection from start (not recommended):
- true - include a default data channel
- {constraints} - include a data channel with specified constraints
Returns
The created call object.
Events
Event wrtc.onConnecting() occurs when call sequence is started. (It may be delayed several seconds if wrtc.call() needs to start websocket or line connection, log in, or acquire mic and cam before call can be placed.)
Event wrtc.onRinging() occurs once the other end reports it has received the call and started ringing.
Event wrtc.onTalking() occurs once other end has answered the call.
There can also be other events occurring during the call.
Example
Most of the time you just call wrtc.call() only with the address argument:
wrtc.call("foo@bar.com");
For more advanced options you can specify extra config:
wrtc.call("foo@bar.com", {callGroup:true, remoteVideo:document.getElementById("video3")});
will call foo@bar.com, include it to current group call, and display received video on HTML <video> object video3