Site Tools


Hotfix release available: 2025-05-14b "Librarian". upgrade now! [56.2] (what's this?)
Hotfix release available: 2025-05-14a "Librarian". upgrade now! [56.1] (what's this?)
New release available: 2025-05-14 "Librarian". upgrade now! [56] (what's this?)
Hotfix release available: 2024-02-06b "Kaos". upgrade now! [55.2] (what's this?)
Hotfix release available: 2024-02-06a "Kaos". upgrade now! [55.1] (what's this?)
New release available: 2024-02-06 "Kaos". upgrade now! [55] (what's this?)
Hotfix release available: 2023-04-04b "Jack Jackrum". upgrade now! [54.2] (what's this?)
Hotfix release available: 2023-04-04a "Jack Jackrum". upgrade now! [54.1] (what's this?)
New release available: 2023-04-04 "Jack Jackrum". upgrade now! [54] (what's this?)
Hotfix release available: 2022-07-31b "Igor". upgrade now! [53.1] (what's this?)
Hotfix release available: 2022-07-31a "Igor". upgrade now! [53] (what's this?)
New release available: 2022-07-31 "Igor". upgrade now! [52.2] (what's this?)
New release candidate 2 available: rc2022-06-26 "Igor". upgrade now! [52.1] (what's this?)
New release candidate available: 2022-06-26 "Igor". upgrade now! [52] (what's this?)
Hotfix release available: 2020-07-29a "Hogfather". upgrade now! [51.4] (what's this?)
New release available: 2020-07-29 "Hogfather". upgrade now! [51.3] (what's this?)
New release candidate 3 available: 2020-06-09 "Hogfather". upgrade now! [51.2] (what's this?)
New release candidate 2 available: 2020-06-01 "Hogfather". upgrade now! [51.1] (what's this?)
New release candidate available: 2020-06-01 "Hogfather". upgrade now! [51] (what's this?)
Hotfix release available: 2018-04-22c "Greebo". upgrade now! [50.3] (what's this?)
Hotfix release available: 2018-04-22b "Greebo". upgrade now! [50.2] (what's this?)
audio_video_calls_over_xmpp

Audio/Video Calls over XMPP

To be able to make audio/video calls using XMPP with ejabberd server

Requirements

For this we are using giggle.js (URL - https://github.com/valeriansaliou/giggle). While this works fine with Chrome, as Chrome has WebRTC support which is required for the connection, we have faced issues with browsers like Safari and IE. For these browsers to enable calling we use external plugins. (See Plugins)

Implementation

There are two ways we can achieve this -

a) XMPP over websocket.

b) XMPP over BOSH.

a) XMPP over websocket (Currently Used)

We can create a new JSJaCWebSocketConnection. Eg URL- https://devtalent01.exphosted.com:5280/websocket

b) XMPP over BOSH

We can create a new JSJaCHttpBindingConnection. Eg URL- https://devtalent01.exphosted.com:5280/http-bind

Code

Following are the code changes that needs to be done for Audio/Video calling in Safari and IE while using the plugin:-

The plugin basically provides the missing methods required for a browser to support calling over WebRTC.

a) getUserMedia() - Used to get access to the media streams (video, audio or both). It takes in 3 parameters:

1> constraints (video, audio or both)
2> success_callback (is fired when getting user media is a "success")
3> failure_callback (is fired when getting user media is a "failure")
Used as:

Plugin.getUserMedia(constraints, success_callback, failure_callback);

b) attachMediaStream() - Used to attach a media stream to a video element. (Basically sets the src of video element). It takes 2 parameters:

1> video element (to which stream would be attached)
2> stream (received from success block of getUserMedia)
Used as:

Eg:- Plugin.attachMediaStream(param1, param 2);

c) RTCSessionDescription - The process of negotiating a connection between two peers involves exchanging RTCSessionDescription objects back and forth until the two peers agree upon a configuration for the connection.

d) RTCIceCandidate - Typically ICE (Interactive Connectivity Establishment) candidate provides the information about the ip-address and port from where the data is going to be exchanged. Normally, it takes 2 params, but 3rd parameter sdpMid is only needed if we are using the plugin:

1> sdpMLineIndex
2> candidate
3> sdpMid

e) RTCPeerConnection() - This interface represents a WebRTC connection between the local computer and a remote peer. It is used to handle efficient streaming of data between the two peers. It takes in 2 parameters:

1> configuration - holds ice server configs
2> constraints - holds stun server configs

The steps and usage of this plugin is take from https://github.com/muaz-khan/PluginRTC

Plugins

audio_video_calls_over_xmpp.txt · Last modified: 2018/08/31 16:16 (external edit)