|
|
@@ -1,4 +1,4 @@
|
|
1
|
|
-/* global __filename, Strophe, Promise */
|
|
|
1
|
+/* global __filename, $, Strophe, Promise */
|
|
2
|
2
|
|
|
3
|
3
|
import AvgRTPStatsReporter from './modules/statistics/AvgRTPStatsReporter';
|
|
4
|
4
|
import ComponentsVersions from './modules/version/ComponentsVersions';
|
|
|
@@ -1390,6 +1390,9 @@ JitsiConference.prototype.onIncomingCall
|
|
1390
|
1390
|
GlobalOnErrorHandler.callErrorHandler(error);
|
|
1391
|
1391
|
}
|
|
1392
|
1392
|
|
|
|
1393
|
+ // Open a channel with the videobridge.
|
|
|
1394
|
+ this._setBridgeChannel(jingleOffer, jingleSession.peerconnection);
|
|
|
1395
|
+
|
|
1393
|
1396
|
// Add local tracks to the session
|
|
1394
|
1397
|
try {
|
|
1395
|
1398
|
jingleSession.acceptOffer(
|
|
|
@@ -1401,9 +1404,6 @@ JitsiConference.prototype.onIncomingCall
|
|
1401
|
1404
|
if (this.isP2PActive() && this.jvbJingleSession) {
|
|
1402
|
1405
|
this._suspendMediaTransferForJvbConnection();
|
|
1403
|
1406
|
}
|
|
1404
|
|
-
|
|
1405
|
|
- // Open a channel with the videobridge.
|
|
1406
|
|
- this._setBridgeChannel();
|
|
1407
|
1407
|
},
|
|
1408
|
1408
|
error => {
|
|
1409
|
1409
|
GlobalOnErrorHandler.callErrorHandler(error);
|
|
|
@@ -1430,10 +1430,24 @@ JitsiConference.prototype.onIncomingCall
|
|
1430
|
1430
|
|
|
1431
|
1431
|
/**
|
|
1432
|
1432
|
* Sets the BridgeChannel.
|
|
|
1433
|
+ *
|
|
|
1434
|
+ * @param {jQuery} offerIq a jQuery selector pointing to the jingle element of
|
|
|
1435
|
+ * the offer IQ which may carry the WebSocket URL for the 'websocket'
|
|
|
1436
|
+ * BridgeChannel mode.
|
|
|
1437
|
+ * @param {TraceablePeerConnection} pc the peer connection which will be used
|
|
|
1438
|
+ * to listen for new WebRTC Data Channels (in the 'datachannel' mode).
|
|
1433
|
1439
|
*/
|
|
1434
|
|
-JitsiConference.prototype._setBridgeChannel = function() {
|
|
1435
|
|
- const jingleSession = this.jvbJingleSession;
|
|
1436
|
|
- const wsUrl = jingleSession.bridgeWebSocketUrl;
|
|
|
1440
|
+JitsiConference.prototype._setBridgeChannel = function(offerIq, pc) {
|
|
|
1441
|
+ let wsUrl = null;
|
|
|
1442
|
+ const webSocket
|
|
|
1443
|
+ = $(offerIq)
|
|
|
1444
|
+ .find('>content>transport>web-socket')
|
|
|
1445
|
+ .first();
|
|
|
1446
|
+
|
|
|
1447
|
+ if (webSocket.length === 1) {
|
|
|
1448
|
+ wsUrl = webSocket[0].getAttribute('url');
|
|
|
1449
|
+ }
|
|
|
1450
|
+
|
|
1437
|
1451
|
let bridgeChannelType;
|
|
1438
|
1452
|
|
|
1439
|
1453
|
switch (this.options.config.openBridgeChannel) {
|
|
|
@@ -1453,7 +1467,7 @@ JitsiConference.prototype._setBridgeChannel = function() {
|
|
1453
|
1467
|
}
|
|
1454
|
1468
|
|
|
1455
|
1469
|
if (bridgeChannelType === 'datachannel') {
|
|
1456
|
|
- this.rtc.initializeBridgeChannel(jingleSession.peerconnection, null);
|
|
|
1470
|
+ this.rtc.initializeBridgeChannel(pc, null);
|
|
1457
|
1471
|
} else if (bridgeChannelType === 'websocket' && wsUrl) {
|
|
1458
|
1472
|
this.rtc.initializeBridgeChannel(null, wsUrl);
|
|
1459
|
1473
|
}
|