|
@@ -11,6 +11,10 @@ var Moderator = (function (my) {
|
11
|
11
|
var getNextErrorTimeout = Util.createExpBackoffTimer(1000);
|
12
|
12
|
// External authentication stuff
|
13
|
13
|
var externalAuthEnabled = false;
|
|
14
|
+ // Sip gateway can be enabled by configuring Jigasi host in config.js or
|
|
15
|
+ // it will be enabled automatically if focus detects the component through
|
|
16
|
+ // service discovery.
|
|
17
|
+ var sipGatewayEnabled = config.hosts.call_control !== undefined;
|
14
|
18
|
|
15
|
19
|
my.isModerator = function () {
|
16
|
20
|
return connection.emuc.isModerator();
|
|
@@ -24,6 +28,10 @@ var Moderator = (function (my) {
|
24
|
28
|
return externalAuthEnabled;
|
25
|
29
|
};
|
26
|
30
|
|
|
31
|
+ my.isSipGatewayEnabled = function () {
|
|
32
|
+ return sipGatewayEnabled;
|
|
33
|
+ };
|
|
34
|
+
|
27
|
35
|
my.onModeratorStatusChanged = function (isModerator) {
|
28
|
36
|
|
29
|
37
|
Toolbar.showSipCallButton(isModerator);
|
|
@@ -99,6 +107,14 @@ var Moderator = (function (my) {
|
99
|
107
|
{ name: 'bridge', value: config.hosts.bridge})
|
100
|
108
|
.up();
|
101
|
109
|
}
|
|
110
|
+ // Tell the focus we have Jigasi configured
|
|
111
|
+ if (config.hosts.call_control !== undefined)
|
|
112
|
+ {
|
|
113
|
+ elem.c(
|
|
114
|
+ 'property',
|
|
115
|
+ { name: 'call_control', value: config.hosts.call_control})
|
|
116
|
+ .up();
|
|
117
|
+ }
|
102
|
118
|
if (config.channelLastN !== undefined)
|
103
|
119
|
{
|
104
|
120
|
elem.c(
|
|
@@ -148,7 +164,17 @@ var Moderator = (function (my) {
|
148
|
164
|
if (extAuthParam.length) {
|
149
|
165
|
externalAuthEnabled = extAuthParam.attr('value') === 'true';
|
150
|
166
|
}
|
|
167
|
+
|
151
|
168
|
console.info("External authentication enabled: " + externalAuthEnabled);
|
|
169
|
+
|
|
170
|
+ // Check if focus has auto-detected Jigasi component(this will be also
|
|
171
|
+ // included if we have passed our host from the config)
|
|
172
|
+ if ($(resultIq).find(
|
|
173
|
+ '>conference>property[name=\'sipGatewayEnabled\']').length) {
|
|
174
|
+ sipGatewayEnabled = true;
|
|
175
|
+ }
|
|
176
|
+
|
|
177
|
+ console.info("Sip gateway enabled: " + sipGatewayEnabled);
|
152
|
178
|
};
|
153
|
179
|
|
154
|
180
|
// FIXME: we need to show the fact that we're waiting for the focus
|