|
@@ -32,13 +32,14 @@ function Moderator(roomName, xmpp, emitter) {
|
32
|
32
|
this.xmppService = xmpp;
|
33
|
33
|
this.getNextTimeout = createExpBackoffTimer(1000);
|
34
|
34
|
this.getNextErrorTimeout = createExpBackoffTimer(1000);
|
35
|
|
-// External authentication stuff
|
|
35
|
+ // External authentication stuff
|
36
|
36
|
this.externalAuthEnabled = false;
|
37
|
37
|
this.settings = new Settings(roomName);
|
38
|
|
-// Sip gateway can be enabled by configuring Jigasi host in config.js or
|
39
|
|
-// it will be enabled automatically if focus detects the component through
|
40
|
|
-// service discovery.
|
41
|
|
- this.sipGatewayEnabled = this.xmppService.options.hosts.call_control !== undefined;
|
|
38
|
+ // Sip gateway can be enabled by configuring Jigasi host in config.js or
|
|
39
|
+ // it will be enabled automatically if focus detects the component through
|
|
40
|
+ // service discovery.
|
|
41
|
+ this.sipGatewayEnabled =
|
|
42
|
+ this.xmppService.options.hosts.call_control !== undefined;
|
42
|
43
|
|
43
|
44
|
this.eventEmitter = emitter;
|
44
|
45
|
|
|
@@ -132,59 +133,68 @@ Moderator.prototype.createConferenceIq = function () {
|
132
|
133
|
}
|
133
|
134
|
if (this.xmppService.options.hosts.bridge !== undefined) {
|
134
|
135
|
elem.c(
|
135
|
|
- 'property',
|
136
|
|
- {name: 'bridge',value: this.xmppService.options.hosts.bridge})
|
137
|
|
- .up();
|
|
136
|
+ 'property', {
|
|
137
|
+ name: 'bridge',
|
|
138
|
+ value: this.xmppService.options.hosts.bridge
|
|
139
|
+ }).up();
|
138
|
140
|
}
|
139
|
141
|
// Tell the focus we have Jigasi configured
|
140
|
142
|
if (this.xmppService.options.hosts.call_control !== undefined) {
|
141
|
143
|
elem.c(
|
142
|
|
- 'property',
|
143
|
|
- {name: 'call_control',value: this.xmppService.options.hosts.call_control})
|
144
|
|
- .up();
|
|
144
|
+ 'property', {
|
|
145
|
+ name: 'call_control',
|
|
146
|
+ value: this.xmppService.options.hosts.call_control
|
|
147
|
+ }).up();
|
145
|
148
|
}
|
146
|
149
|
if (this.xmppService.options.channelLastN !== undefined) {
|
147
|
150
|
elem.c(
|
148
|
|
- 'property',
|
149
|
|
- {name: 'channelLastN',value: this.xmppService.options.channelLastN})
|
150
|
|
- .up();
|
|
151
|
+ 'property', {
|
|
152
|
+ name: 'channelLastN',
|
|
153
|
+ value: this.xmppService.options.channelLastN
|
|
154
|
+ }).up();
|
151
|
155
|
}
|
152
|
156
|
if (this.xmppService.options.adaptiveLastN !== undefined) {
|
153
|
157
|
elem.c(
|
154
|
|
- 'property',
|
155
|
|
- {name: 'adaptiveLastN',value: this.xmppService.options.adaptiveLastN})
|
156
|
|
- .up();
|
|
158
|
+ 'property', {
|
|
159
|
+ name: 'adaptiveLastN',
|
|
160
|
+ value: this.xmppService.options.adaptiveLastN
|
|
161
|
+ }).up();
|
157
|
162
|
}
|
158
|
163
|
if (this.xmppService.options.adaptiveSimulcast !== undefined) {
|
159
|
164
|
elem.c(
|
160
|
|
- 'property',
|
161
|
|
- {name: 'adaptiveSimulcast',value: this.xmppService.options.adaptiveSimulcast})
|
162
|
|
- .up();
|
|
165
|
+ 'property', {
|
|
166
|
+ name: 'adaptiveSimulcast',
|
|
167
|
+ value: this.xmppService.options.adaptiveSimulcast
|
|
168
|
+ }).up();
|
163
|
169
|
}
|
164
|
170
|
if (this.xmppService.options.openSctp !== undefined) {
|
165
|
171
|
elem.c(
|
166
|
|
- 'property',
|
167
|
|
- {name: 'openSctp',value: this.xmppService.options.openSctp})
|
168
|
|
- .up();
|
|
172
|
+ 'property', {
|
|
173
|
+ name: 'openSctp',
|
|
174
|
+ value: this.xmppService.options.openSctp
|
|
175
|
+ }).up();
|
169
|
176
|
}
|
170
|
|
- if(this.xmppService.options.startAudioMuted !== undefined)
|
|
177
|
+ if (this.xmppService.options.startAudioMuted !== undefined)
|
171
|
178
|
{
|
172
|
179
|
elem.c(
|
173
|
|
- 'property',
|
174
|
|
- {name: 'startAudioMuted',value: this.xmppService.options.startAudioMuted})
|
175
|
|
- .up();
|
|
180
|
+ 'property', {
|
|
181
|
+ name: 'startAudioMuted',
|
|
182
|
+ value: this.xmppService.options.startAudioMuted
|
|
183
|
+ }).up();
|
176
|
184
|
}
|
177
|
|
- if(this.xmppService.options.startVideoMuted !== undefined)
|
|
185
|
+ if (this.xmppService.options.startVideoMuted !== undefined)
|
178
|
186
|
{
|
179
|
187
|
elem.c(
|
180
|
|
- 'property',
|
181
|
|
- {name: 'startVideoMuted',value: this.xmppService.options.startVideoMuted})
|
182
|
|
- .up();
|
|
188
|
+ 'property', {
|
|
189
|
+ name: 'startVideoMuted',
|
|
190
|
+ value: this.xmppService.options.startVideoMuted
|
|
191
|
+ }).up();
|
183
|
192
|
}
|
184
|
193
|
elem.c(
|
185
|
|
- 'property',
|
186
|
|
- {name: 'simulcastMode',value: 'rewriting'})
|
187
|
|
- .up();
|
|
194
|
+ 'property', {
|
|
195
|
+ name: 'simulcastMode',
|
|
196
|
+ value: 'rewriting'
|
|
197
|
+ }).up();
|
188
|
198
|
elem.up();
|
189
|
199
|
return elem;
|
190
|
200
|
};
|
|
@@ -214,7 +224,8 @@ Moderator.prototype.parseConfigOptions = function (resultIq) {
|
214
|
224
|
'>conference>property' +
|
215
|
225
|
'[name=\'externalAuth\'][value=\'true\']').length > 0;
|
216
|
226
|
|
217
|
|
- logger.info('External authentication enabled: ' + this.externalAuthEnabled);
|
|
227
|
+ console.info(
|
|
228
|
+ 'External authentication enabled: ' + this.externalAuthEnabled);
|
218
|
229
|
|
219
|
230
|
if (!this.externalAuthEnabled) {
|
220
|
231
|
// We expect to receive sessionId in 'internal' authentication mode
|
|
@@ -239,7 +250,7 @@ Moderator.prototype.parseConfigOptions = function (resultIq) {
|
239
|
250
|
|
240
|
251
|
// FIXME = we need to show the fact that we're waiting for the focus
|
241
|
252
|
// to the user(or that focus is not available)
|
242
|
|
-Moderator.prototype.allocateConferenceFocus = function ( callback) {
|
|
253
|
+Moderator.prototype.allocateConferenceFocus = function (callback) {
|
243
|
254
|
// Try to use focus user JID from the config
|
244
|
255
|
this.setFocusUserJid(this.xmppService.options.focusUserJid);
|
245
|
256
|
// Send create conference IQ
|
|
@@ -300,7 +311,8 @@ Moderator.prototype.allocateConferenceFocus = function ( callback) {
|
300
|
311
|
logger.warn("Unauthorized to start the conference", error);
|
301
|
312
|
var toDomain
|
302
|
313
|
= Strophe.getDomainFromJid(error.getAttribute('to'));
|
303
|
|
- if (toDomain !== this.xmppService.options.hosts.anonymousdomain) {
|
|
314
|
+ if (toDomain !==
|
|
315
|
+ this.xmppService.options.hosts.anonymousdomain) {
|
304
|
316
|
//FIXME: "is external" should come either from
|
305
|
317
|
// the focus or config.js
|
306
|
318
|
self.externalAuthEnabled = true;
|