Bladeren bron

adds conference to lookup of dial in numbers (#3859)

master
Aaron van Meerten 6 jaren geleden
bovenliggende
commit
b9a14acd3c

+ 1
- 1
react/features/invite/actions.js Bestand weergeven

174
         const { room } = state['features/base/conference'];
174
         const { room } = state['features/base/conference'];
175
 
175
 
176
         Promise.all([
176
         Promise.all([
177
-            getDialInNumbers(dialInNumbersUrl),
177
+            getDialInNumbers(dialInNumbersUrl, room, mucURL),
178
             getDialInConferenceID(dialInConfCodeUrl, room, mucURL)
178
             getDialInConferenceID(dialInConfCodeUrl, room, mucURL)
179
         ])
179
         ])
180
             .then(([ dialInNumbers, { conference, id, message } ]) => {
180
             .then(([ dialInNumbers, { conference, id, message } ]) => {

+ 14
- 2
react/features/invite/components/dial-in-summary/DialInSummary.web.js Bestand weergeven

190
      * @returns {Promise}
190
      * @returns {Promise}
191
      */
191
      */
192
     _getNumbers() {
192
     _getNumbers() {
193
-        const { dialInNumbersUrl } = config;
193
+        const { room } = this.props;
194
+        const { dialInNumbersUrl, hosts } = config;
195
+        const mucURL = hosts && hosts.muc;
196
+        let URLSuffix = '';
194
 
197
 
195
         if (!dialInNumbersUrl) {
198
         if (!dialInNumbersUrl) {
196
             return Promise.reject(this.props.t('info.dialInNotSupported'));
199
             return Promise.reject(this.props.t('info.dialInNotSupported'));
197
         }
200
         }
198
 
201
 
199
-        return fetch(dialInNumbersUrl)
202
+        // when room and mucURL are available
203
+        // provide conference when looking up dial in numbers
204
+
205
+        if (room && mucURL) {
206
+            URLSuffix = `?conference=${room}@${mucURL}`;
207
+        }
208
+        const conferenceIDURL
209
+        = `${dialInNumbersUrl}${URLSuffix}`;
210
+
211
+        return fetch(conferenceIDURL)
200
             .then(response => response.json())
212
             .then(response => response.json())
201
             .catch(() => Promise.reject(this.props.t('info.genericError')));
213
             .catch(() => Promise.reject(this.props.t('info.genericError')));
202
     }
214
     }

+ 13
- 3
react/features/invite/functions.js Bestand weergeven

56
  * Sends a GET request for phone numbers used to dial into a conference.
56
  * Sends a GET request for phone numbers used to dial into a conference.
57
  *
57
  *
58
  * @param {string} url - The service that returns confernce dial-in numbers.
58
  * @param {string} url - The service that returns confernce dial-in numbers.
59
+ * @param {string} roomName - The conference name to find the associated
60
+ * conference ID.
61
+ * @param {string} mucURL - In which MUC the conference exists.
59
  * @returns {Promise} - The promise created by the request. The returned numbers
62
  * @returns {Promise} - The promise created by the request. The returned numbers
60
  * may be an array of numbers or an object with countries as keys and arrays of
63
  * may be an array of numbers or an object with countries as keys and arrays of
61
  * phone number strings.
64
  * phone number strings.
62
  */
65
  */
63
-export function getDialInNumbers(url: string): Promise<*> {
64
-    return doGetJSON(url);
66
+export function getDialInNumbers(
67
+        url: string,
68
+        roomName: string,
69
+        mucURL: string
70
+): Promise<*> {
71
+
72
+    const fullUrl = `${url}?conference=${roomName}@${mucURL}`;
73
+
74
+    return doGetJSON(fullUrl);
65
 }
75
 }
66
 
76
 
67
 /**
77
 /**
442
             }
452
             }
443
 
453
 
444
             numbersPromise = Promise.all([
454
             numbersPromise = Promise.all([
445
-                getDialInNumbers(dialInNumbersUrl),
455
+                getDialInNumbers(dialInNumbersUrl, room, mucURL),
446
                 getDialInConferenceID(dialInConfCodeUrl, room, mucURL)
456
                 getDialInConferenceID(dialInConfCodeUrl, room, mucURL)
447
             ]).then(([ { defaultCountry, numbers }, {
457
             ]).then(([ { defaultCountry, numbers }, {
448
                 conference, id, message } ]) => {
458
                 conference, id, message } ]) => {

Laden…
Annuleren
Opslaan