소스 검색

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

j8
Aaron van Meerten 6 년 전
부모
커밋
b9a14acd3c
3개의 변경된 파일28개의 추가작업 그리고 6개의 파일을 삭제
  1. 1
    1
      react/features/invite/actions.js
  2. 14
    2
      react/features/invite/components/dial-in-summary/DialInSummary.web.js
  3. 13
    3
      react/features/invite/functions.js

+ 1
- 1
react/features/invite/actions.js 파일 보기

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

+ 14
- 2
react/features/invite/components/dial-in-summary/DialInSummary.web.js 파일 보기

@@ -190,13 +190,25 @@ class DialInSummary extends Component<Props, State> {
190 190
      * @returns {Promise}
191 191
      */
192 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 198
         if (!dialInNumbersUrl) {
196 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 212
             .then(response => response.json())
201 213
             .catch(() => Promise.reject(this.props.t('info.genericError')));
202 214
     }

+ 13
- 3
react/features/invite/functions.js 파일 보기

@@ -56,12 +56,22 @@ export function getDialInConferenceID(
56 56
  * Sends a GET request for phone numbers used to dial into a conference.
57 57
  *
58 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 62
  * @returns {Promise} - The promise created by the request. The returned numbers
60 63
  * may be an array of numbers or an object with countries as keys and arrays of
61 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,7 +452,7 @@ export function getShareInfoText(
442 452
             }
443 453
 
444 454
             numbersPromise = Promise.all([
445
-                getDialInNumbers(dialInNumbersUrl),
455
+                getDialInNumbers(dialInNumbersUrl, room, mucURL),
446 456
                 getDialInConferenceID(dialInConfCodeUrl, room, mucURL)
447 457
             ]).then(([ { defaultCountry, numbers }, {
448 458
                 conference, id, message } ]) => {

Loading…
취소
저장