|
|
@@ -456,6 +456,45 @@ JitsiConference.prototype.toggleRecording = function (token) {
|
|
456
|
456
|
reject(new Error("The conference is not created yet!"))});
|
|
457
|
457
|
}
|
|
458
|
458
|
|
|
|
459
|
+/**
|
|
|
460
|
+ * Dials a number.
|
|
|
461
|
+ * @param number the number
|
|
|
462
|
+ */
|
|
|
463
|
+JitsiConference.prototype.dial = function (number) {
|
|
|
464
|
+ if(this.room)
|
|
|
465
|
+ return this.room.dial(number);
|
|
|
466
|
+ return new Promise(function(resolve, reject){
|
|
|
467
|
+ reject(new Error("The conference is not created yet!"))});
|
|
|
468
|
+}
|
|
|
469
|
+
|
|
|
470
|
+/**
|
|
|
471
|
+ * Hangup an existing call
|
|
|
472
|
+ */
|
|
|
473
|
+JitsiConference.prototype.hangup = function () {
|
|
|
474
|
+ if(this.room)
|
|
|
475
|
+ return this.room.hangup();
|
|
|
476
|
+ return new Promise(function(resolve, reject){
|
|
|
477
|
+ reject(new Error("The conference is not created yet!"))});
|
|
|
478
|
+}
|
|
|
479
|
+
|
|
|
480
|
+/**
|
|
|
481
|
+ * Returns the phone number for joining the conference.
|
|
|
482
|
+ */
|
|
|
483
|
+JitsiConference.prototype.getPhoneNumber = function () {
|
|
|
484
|
+ if(this.room)
|
|
|
485
|
+ return this.room.getPhoneNumber();
|
|
|
486
|
+ return null;
|
|
|
487
|
+}
|
|
|
488
|
+
|
|
|
489
|
+/**
|
|
|
490
|
+ * Returns the pin for joining the conference with phone.
|
|
|
491
|
+ */
|
|
|
492
|
+JitsiConference.prototype.getPhonePin = function () {
|
|
|
493
|
+ if(this.room)
|
|
|
494
|
+ return this.room.getPhonePin();
|
|
|
495
|
+ return null;
|
|
|
496
|
+}
|
|
|
497
|
+
|
|
459
|
498
|
/**
|
|
460
|
499
|
* Setups the listeners needed for the conference.
|
|
461
|
500
|
* @param conference the conference
|
|
|
@@ -497,8 +536,16 @@ function setupListeners(conference) {
|
|
497
|
536
|
conference.room.addListener(XMPPEvents.CONNECTION_INTERRUPTED, function () {
|
|
498
|
537
|
conference.eventEmitter.emit(JitsiConferenceEvents.CONNECTION_INTERRUPTED);
|
|
499
|
538
|
});
|
|
500
|
|
- conference.room.addListener(XMPPEvents.RECORDING_STATE_CHANGED, function () {
|
|
501
|
|
- conference.eventEmitter.emit(JitsiConferenceEvents.RECORDING_STATE_CHANGED);
|
|
|
539
|
+
|
|
|
540
|
+ conference.room.addListener(XMPPEvents.RECORDING_STATE_CHANGED,
|
|
|
541
|
+ function () {
|
|
|
542
|
+ conference.eventEmitter.emit(
|
|
|
543
|
+ JitsiConferenceEvents.RECORDING_STATE_CHANGED);
|
|
|
544
|
+ });
|
|
|
545
|
+
|
|
|
546
|
+ conference.room.addListener(XMPPEvents.PHONE_NUMBER_CHANGED, function () {
|
|
|
547
|
+ conference.eventEmitter.emit(
|
|
|
548
|
+ JitsiConferenceEvents.PHONE_NUMBER_CHANGED);
|
|
502
|
549
|
});
|
|
503
|
550
|
|
|
504
|
551
|
conference.room.addListener(XMPPEvents.CONNECTION_RESTORED, function () {
|
|
|
@@ -666,7 +713,11 @@ var JitsiConferenceEvents = {
|
|
666
|
713
|
/**
|
|
667
|
714
|
* Indicates that recording state changed.
|
|
668
|
715
|
*/
|
|
669
|
|
- RECORDING_STATE_CHANGED: "conference.recordingStateChanged"
|
|
|
716
|
+ RECORDING_STATE_CHANGED: "conference.recordingStateChanged",
|
|
|
717
|
+ /**
|
|
|
718
|
+ * Indicates that phone number changed.
|
|
|
719
|
+ */
|
|
|
720
|
+ PHONE_NUMBER_CHANGED: "conference.phoneNumberChanged"
|
|
670
|
721
|
};
|
|
671
|
722
|
|
|
672
|
723
|
module.exports = JitsiConferenceEvents;
|
|
|
@@ -5830,6 +5881,8 @@ function ChatRoom(connection, jid, password, XMPP, options) {
|
|
5830
|
5881
|
this.session = null;
|
|
5831
|
5882
|
var self = this;
|
|
5832
|
5883
|
this.lastPresences = {};
|
|
|
5884
|
+ this.phoneNumber = null;
|
|
|
5885
|
+ this.phonePin = null;
|
|
5833
|
5886
|
}
|
|
5834
|
5887
|
|
|
5835
|
5888
|
ChatRoom.prototype.initPresenceMap = function () {
|
|
|
@@ -5947,6 +6000,7 @@ ChatRoom.prototype.createNonAnonymousRoom = function () {
|
|
5947
|
6000
|
};
|
|
5948
|
6001
|
|
|
5949
|
6002
|
ChatRoom.prototype.onPresence = function (pres) {
|
|
|
6003
|
+ console.log(pres);
|
|
5950
|
6004
|
var from = pres.getAttribute('from');
|
|
5951
|
6005
|
// Parse roles.
|
|
5952
|
6006
|
var member = {};
|
|
|
@@ -6000,6 +6054,16 @@ ChatRoom.prototype.onPresence = function (pres) {
|
|
6000
|
6054
|
break;
|
|
6001
|
6055
|
case "jibri-recording-status":
|
|
6002
|
6056
|
var jibri = node;
|
|
|
6057
|
+ break;
|
|
|
6058
|
+ case "call-control":
|
|
|
6059
|
+ console.log(pres);
|
|
|
6060
|
+ var att = node.attributes;
|
|
|
6061
|
+ if(!att)
|
|
|
6062
|
+ break;
|
|
|
6063
|
+ this.phoneNumber = att.phone || null;
|
|
|
6064
|
+ this.phonePin = att.pin || null;
|
|
|
6065
|
+ this.eventEmitter.emit(XMPPEvents.PHONE_NUMBER_CHANGED);
|
|
|
6066
|
+ break;
|
|
6003
|
6067
|
default :
|
|
6004
|
6068
|
this.processNode(node, from);
|
|
6005
|
6069
|
}
|
|
|
@@ -6440,13 +6504,44 @@ ChatRoom.prototype.getRecordingURL = function () {
|
|
6440
|
6504
|
* @param token token for authentication
|
|
6441
|
6505
|
*/
|
|
6442
|
6506
|
ChatRoom.prototype.toggleRecording = function (token) {
|
|
6443
|
|
- if(this.recording/** && this.isModerator()**/)
|
|
|
6507
|
+ if(this.recording)
|
|
6444
|
6508
|
return this.recording.toggleRecording(token);
|
|
6445
|
6509
|
|
|
6446
|
6510
|
return new Promise(function(resolve, reject){
|
|
6447
|
6511
|
reject(new Error("The conference is not created yet!"))});
|
|
6448
|
6512
|
}
|
|
6449
|
6513
|
|
|
|
6514
|
+/**
|
|
|
6515
|
+ * Dials a number.
|
|
|
6516
|
+ * @param number the number
|
|
|
6517
|
+ */
|
|
|
6518
|
+ChatRoom.prototype.dial = function (number) {
|
|
|
6519
|
+ return this.connection.rayo.dial(number, "fromnumber",
|
|
|
6520
|
+ Strophe.getNodeFromJid(this.myroomjid), this.password,
|
|
|
6521
|
+ this.focusMucJid);
|
|
|
6522
|
+}
|
|
|
6523
|
+
|
|
|
6524
|
+/**
|
|
|
6525
|
+ * Hangup an existing call
|
|
|
6526
|
+ */
|
|
|
6527
|
+ChatRoom.prototype.hangup = function () {
|
|
|
6528
|
+ return this.connection.rayo.hangup();
|
|
|
6529
|
+}
|
|
|
6530
|
+
|
|
|
6531
|
+/**
|
|
|
6532
|
+ * Returns the phone number for joining the conference.
|
|
|
6533
|
+ */
|
|
|
6534
|
+ChatRoom.prototype.getPhoneNumber = function () {
|
|
|
6535
|
+ return this.phoneNumber;
|
|
|
6536
|
+}
|
|
|
6537
|
+
|
|
|
6538
|
+/**
|
|
|
6539
|
+ * Returns the pin for joining the conference with phone.
|
|
|
6540
|
+ */
|
|
|
6541
|
+ChatRoom.prototype.getPhonePin = function () {
|
|
|
6542
|
+ return this.phonePin;
|
|
|
6543
|
+}
|
|
|
6544
|
+
|
|
6450
|
6545
|
module.exports = ChatRoom;
|
|
6451
|
6546
|
|
|
6452
|
6547
|
}).call(this,"/modules/xmpp/ChatRoom.js")
|
|
|
@@ -10601,9 +10696,11 @@ module.exports = Moderator;
|
|
10601
|
10696
|
|
|
10602
|
10697
|
}).call(this,"/modules/xmpp/moderator.js")
|
|
10603
|
10698
|
},{"../../service/authentication/AuthenticationEvents":87,"../../service/xmpp/XMPPEvents":91,"../settings/Settings":21,"jitsi-meet-logger":48}],35:[function(require,module,exports){
|
|
|
10699
|
+(function (__filename){
|
|
10604
|
10700
|
/* global $, $iq, config, connection, focusMucJid, messageHandler,
|
|
10605
|
10701
|
Toolbar, Util, Promise */
|
|
10606
|
10702
|
var XMPPEvents = require("../../service/XMPP/XMPPEvents");
|
|
|
10703
|
+var logger = require("jitsi-meet-logger").getLogger(__filename);
|
|
10607
|
10704
|
|
|
10608
|
10705
|
function Recording(ee, connection, focusMucJid) {
|
|
10609
|
10706
|
this.eventEmitter = ee;
|
|
|
@@ -10643,7 +10740,7 @@ Recording.prototype.setRecording = function (state, streamId, callback,
|
|
10643
|
10740
|
streamid: streamId
|
|
10644
|
10741
|
}).up();
|
|
10645
|
10742
|
|
|
10646
|
|
- console.log('Set jibri recording: '+state, iq);
|
|
|
10743
|
+ logger.log('Set jibri recording: '+state, iq);
|
|
10647
|
10744
|
|
|
10648
|
10745
|
this.connection.sendIQ(
|
|
10649
|
10746
|
iq,
|
|
|
@@ -10652,7 +10749,7 @@ Recording.prototype.setRecording = function (state, streamId, callback,
|
|
10652
|
10749
|
$(result).find('jibri').attr('url'));
|
|
10653
|
10750
|
},
|
|
10654
|
10751
|
function (error) {
|
|
10655
|
|
- console.log('Failed to start recording, error: ', error);
|
|
|
10752
|
+ logger.log('Failed to start recording, error: ', error);
|
|
10656
|
10753
|
errCallback(error);
|
|
10657
|
10754
|
});
|
|
10658
|
10755
|
};
|
|
|
@@ -10661,8 +10758,14 @@ Recording.prototype.toggleRecording = function (token) {
|
|
10661
|
10758
|
var self = this;
|
|
10662
|
10759
|
return new Promise(function(resolve, reject) {
|
|
10663
|
10760
|
if (!token) {
|
|
10664
|
|
- console.error("No token passed!");
|
|
10665
|
10761
|
reject(new Error("No token passed!"));
|
|
|
10762
|
+ logger.error("No token passed!");
|
|
|
10763
|
+ return;
|
|
|
10764
|
+ }
|
|
|
10765
|
+ if(self.state === "on") {
|
|
|
10766
|
+ reject(new Error("Recording is already started!"));
|
|
|
10767
|
+ logger.error("Recording is already started!");
|
|
|
10768
|
+ return;
|
|
10666
|
10769
|
}
|
|
10667
|
10770
|
|
|
10668
|
10771
|
var oldState = self.state;
|
|
|
@@ -10671,7 +10774,7 @@ Recording.prototype.toggleRecording = function (token) {
|
|
10671
|
10774
|
self.setRecording(newState,
|
|
10672
|
10775
|
token,
|
|
10673
|
10776
|
function (state, url) {
|
|
10674
|
|
- console.log("New recording state: ", state);
|
|
|
10777
|
+ logger.log("New recording state: ", state);
|
|
10675
|
10778
|
if (state && state !== oldState) {
|
|
10676
|
10779
|
self.state = state;
|
|
10677
|
10780
|
self.url = url;
|
|
|
@@ -10711,7 +10814,8 @@ Recording.prototype.getURL = function () {
|
|
10711
|
10814
|
|
|
10712
|
10815
|
module.exports = Recording;
|
|
10713
|
10816
|
|
|
10714
|
|
-},{"../../service/XMPP/XMPPEvents":86}],36:[function(require,module,exports){
|
|
|
10817
|
+}).call(this,"/modules/xmpp/recording.js")
|
|
|
10818
|
+},{"../../service/XMPP/XMPPEvents":86,"jitsi-meet-logger":48}],36:[function(require,module,exports){
|
|
10715
|
10819
|
(function (__filename){
|
|
10716
|
10820
|
/* jshint -W117 */
|
|
10717
|
10821
|
/* a simple MUC connection plugin
|
|
|
@@ -11270,85 +11374,102 @@ module.exports = function() {
|
|
11270
|
11374
|
}
|
|
11271
|
11375
|
|
|
11272
|
11376
|
this.connection.addHandler(
|
|
11273
|
|
- this.onRayo.bind(this),
|
|
11274
|
|
- this.RAYO_XMLNS, 'iq', 'set', null, null);
|
|
|
11377
|
+ this.onRayo.bind(this), this.RAYO_XMLNS, 'iq', 'set',
|
|
|
11378
|
+ null, null);
|
|
11275
|
11379
|
},
|
|
11276
|
11380
|
onRayo: function (iq) {
|
|
11277
|
11381
|
logger.info("Rayo IQ", iq);
|
|
11278
|
11382
|
},
|
|
11279
|
|
- dial: function (to, from, roomName, roomPass) {
|
|
|
11383
|
+ dial: function (to, from, roomName, roomPass, focusMucJid) {
|
|
11280
|
11384
|
var self = this;
|
|
11281
|
|
- var req = $iq(
|
|
11282
|
|
- {
|
|
11283
|
|
- type: 'set',
|
|
11284
|
|
- to: this.connection.emuc.focusMucJid
|
|
|
11385
|
+ return new Promise(function (resolve, reject) {
|
|
|
11386
|
+ if(self.call_resource) {
|
|
|
11387
|
+ reject(new Error("There is already started call!"));
|
|
|
11388
|
+ return;
|
|
11285
|
11389
|
}
|
|
11286
|
|
- );
|
|
11287
|
|
- req.c('dial',
|
|
11288
|
|
- {
|
|
11289
|
|
- xmlns: this.RAYO_XMLNS,
|
|
11290
|
|
- to: to,
|
|
11291
|
|
- from: from
|
|
11292
|
|
- });
|
|
11293
|
|
- req.c('header',
|
|
11294
|
|
- {
|
|
11295
|
|
- name: 'JvbRoomName',
|
|
11296
|
|
- value: roomName
|
|
11297
|
|
- }).up();
|
|
11298
|
|
-
|
|
11299
|
|
- if (roomPass !== null && roomPass.length) {
|
|
11300
|
|
-
|
|
|
11390
|
+ if(!focusMucJid) {
|
|
|
11391
|
+ reject(new Error("Internal error!"));
|
|
|
11392
|
+ return;
|
|
|
11393
|
+ }
|
|
|
11394
|
+ var req = $iq(
|
|
|
11395
|
+ {
|
|
|
11396
|
+ type: 'set',
|
|
|
11397
|
+ to: focusMucJid
|
|
|
11398
|
+ }
|
|
|
11399
|
+ );
|
|
|
11400
|
+ req.c('dial',
|
|
|
11401
|
+ {
|
|
|
11402
|
+ xmlns: self.RAYO_XMLNS,
|
|
|
11403
|
+ to: to,
|
|
|
11404
|
+ from: from
|
|
|
11405
|
+ });
|
|
11301
|
11406
|
req.c('header',
|
|
11302
|
11407
|
{
|
|
11303
|
|
- name: 'JvbRoomPassword',
|
|
11304
|
|
- value: roomPass
|
|
|
11408
|
+ name: 'JvbRoomName',
|
|
|
11409
|
+ value: roomName
|
|
11305
|
11410
|
}).up();
|
|
11306
|
|
- }
|
|
11307
|
11411
|
|
|
11308
|
|
- this.connection.sendIQ(
|
|
11309
|
|
- req,
|
|
11310
|
|
- function (result) {
|
|
11311
|
|
- logger.info('Dial result ', result);
|
|
|
11412
|
+ if (roomPass !== null && roomPass.length) {
|
|
11312
|
11413
|
|
|
11313
|
|
- var resource = $(result).find('ref').attr('uri');
|
|
11314
|
|
- this.call_resource = resource.substr('xmpp:'.length);
|
|
11315
|
|
- logger.info(
|
|
11316
|
|
- "Received call resource: " + this.call_resource);
|
|
11317
|
|
- },
|
|
11318
|
|
- function (error) {
|
|
11319
|
|
- logger.info('Dial error ', error);
|
|
|
11414
|
+ req.c('header',
|
|
|
11415
|
+ {
|
|
|
11416
|
+ name: 'JvbRoomPassword',
|
|
|
11417
|
+ value: roomPass
|
|
|
11418
|
+ }).up();
|
|
11320
|
11419
|
}
|
|
11321
|
|
- );
|
|
11322
|
|
- },
|
|
11323
|
|
- hang_up: function () {
|
|
11324
|
|
- if (!this.call_resource) {
|
|
11325
|
|
- logger.warn("No call in progress");
|
|
11326
|
|
- return;
|
|
11327
|
|
- }
|
|
11328
|
11420
|
|
|
|
11421
|
+ self.connection.sendIQ(
|
|
|
11422
|
+ req,
|
|
|
11423
|
+ function (result) {
|
|
|
11424
|
+ logger.info('Dial result ', result);
|
|
|
11425
|
+
|
|
|
11426
|
+ var resource = $(result).find('ref').attr('uri');
|
|
|
11427
|
+ self.call_resource = resource.substr('xmpp:'.length);
|
|
|
11428
|
+ logger.info(
|
|
|
11429
|
+ "Received call resource: " + self.call_resource);
|
|
|
11430
|
+ resolve();
|
|
|
11431
|
+ },
|
|
|
11432
|
+ function (error) {
|
|
|
11433
|
+ logger.info('Dial error ', error);
|
|
|
11434
|
+ reject(error);
|
|
|
11435
|
+ }
|
|
|
11436
|
+ );
|
|
|
11437
|
+ });
|
|
|
11438
|
+ },
|
|
|
11439
|
+ hangup: function () {
|
|
11329
|
11440
|
var self = this;
|
|
11330
|
|
- var req = $iq(
|
|
11331
|
|
- {
|
|
11332
|
|
- type: 'set',
|
|
11333
|
|
- to: this.call_resource
|
|
|
11441
|
+ return new Promise(function (resolve, reject) {
|
|
|
11442
|
+ if (!self.call_resource) {
|
|
|
11443
|
+ reject(new Error("No call in progress"));
|
|
|
11444
|
+ logger.warn("No call in progress");
|
|
|
11445
|
+ return;
|
|
11334
|
11446
|
}
|
|
11335
|
|
- );
|
|
11336
|
|
- req.c('hangup',
|
|
11337
|
|
- {
|
|
11338
|
|
- xmlns: this.RAYO_XMLNS
|
|
11339
|
|
- });
|
|
11340
|
11447
|
|
|
11341
|
|
- this.connection.sendIQ(
|
|
11342
|
|
- req,
|
|
11343
|
|
- function (result) {
|
|
11344
|
|
- logger.info('Hangup result ', result);
|
|
11345
|
|
- self.call_resource = null;
|
|
11346
|
|
- },
|
|
11347
|
|
- function (error) {
|
|
11348
|
|
- logger.info('Hangup error ', error);
|
|
11349
|
|
- self.call_resource = null;
|
|
11350
|
|
- }
|
|
11351
|
|
- );
|
|
|
11448
|
+ var req = $iq(
|
|
|
11449
|
+ {
|
|
|
11450
|
+ type: 'set',
|
|
|
11451
|
+ to: self.call_resource
|
|
|
11452
|
+ }
|
|
|
11453
|
+ );
|
|
|
11454
|
+ req.c('hangup',
|
|
|
11455
|
+ {
|
|
|
11456
|
+ xmlns: self.RAYO_XMLNS
|
|
|
11457
|
+ });
|
|
|
11458
|
+
|
|
|
11459
|
+ self.connection.sendIQ(
|
|
|
11460
|
+ req,
|
|
|
11461
|
+ function (result) {
|
|
|
11462
|
+ logger.info('Hangup result ', result);
|
|
|
11463
|
+ self.call_resource = null;
|
|
|
11464
|
+ resolve();
|
|
|
11465
|
+ },
|
|
|
11466
|
+ function (error) {
|
|
|
11467
|
+ logger.info('Hangup error ', error);
|
|
|
11468
|
+ self.call_resource = null;
|
|
|
11469
|
+ reject(new Error('Hangup error '));
|
|
|
11470
|
+ }
|
|
|
11471
|
+ );
|
|
|
11472
|
+ });
|
|
11352
|
11473
|
}
|
|
11353
|
11474
|
}
|
|
11354
|
11475
|
);
|
|
|
@@ -22934,7 +23055,11 @@ var XMPPEvents = {
|
|
22934
|
23055
|
/**
|
|
22935
|
23056
|
* Indicates that recording state changed.
|
|
22936
|
23057
|
*/
|
|
22937
|
|
- RECORDING_STATE_CHANGED: "xmpp.recordingStateChanged"
|
|
|
23058
|
+ RECORDING_STATE_CHANGED: "xmpp.recordingStateChanged",
|
|
|
23059
|
+ /**
|
|
|
23060
|
+ * Indicates that phone number changed.
|
|
|
23061
|
+ */
|
|
|
23062
|
+ PHONE_NUMBER_CHANGED: "conference.phoneNumberChanged"
|
|
22938
|
23063
|
};
|
|
22939
|
23064
|
module.exports = XMPPEvents;
|
|
22940
|
23065
|
|