adds conference to lookup of dial in numbers (#3859)
This commit is contained in:
parent
c998dbb47e
commit
b9a14acd3c
|
@ -174,7 +174,7 @@ export function updateDialInNumbers() {
|
||||||
const { room } = state['features/base/conference'];
|
const { room } = state['features/base/conference'];
|
||||||
|
|
||||||
Promise.all([
|
Promise.all([
|
||||||
getDialInNumbers(dialInNumbersUrl),
|
getDialInNumbers(dialInNumbersUrl, room, mucURL),
|
||||||
getDialInConferenceID(dialInConfCodeUrl, room, mucURL)
|
getDialInConferenceID(dialInConfCodeUrl, room, mucURL)
|
||||||
])
|
])
|
||||||
.then(([ dialInNumbers, { conference, id, message } ]) => {
|
.then(([ dialInNumbers, { conference, id, message } ]) => {
|
||||||
|
|
|
@ -190,13 +190,25 @@ class DialInSummary extends Component<Props, State> {
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
_getNumbers() {
|
_getNumbers() {
|
||||||
const { dialInNumbersUrl } = config;
|
const { room } = this.props;
|
||||||
|
const { dialInNumbersUrl, hosts } = config;
|
||||||
|
const mucURL = hosts && hosts.muc;
|
||||||
|
let URLSuffix = '';
|
||||||
|
|
||||||
if (!dialInNumbersUrl) {
|
if (!dialInNumbersUrl) {
|
||||||
return Promise.reject(this.props.t('info.dialInNotSupported'));
|
return Promise.reject(this.props.t('info.dialInNotSupported'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return fetch(dialInNumbersUrl)
|
// when room and mucURL are available
|
||||||
|
// provide conference when looking up dial in numbers
|
||||||
|
|
||||||
|
if (room && mucURL) {
|
||||||
|
URLSuffix = `?conference=${room}@${mucURL}`;
|
||||||
|
}
|
||||||
|
const conferenceIDURL
|
||||||
|
= `${dialInNumbersUrl}${URLSuffix}`;
|
||||||
|
|
||||||
|
return fetch(conferenceIDURL)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.catch(() => Promise.reject(this.props.t('info.genericError')));
|
.catch(() => Promise.reject(this.props.t('info.genericError')));
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,12 +56,22 @@ export function getDialInConferenceID(
|
||||||
* Sends a GET request for phone numbers used to dial into a conference.
|
* Sends a GET request for phone numbers used to dial into a conference.
|
||||||
*
|
*
|
||||||
* @param {string} url - The service that returns confernce dial-in numbers.
|
* @param {string} url - The service that returns confernce dial-in numbers.
|
||||||
|
* @param {string} roomName - The conference name to find the associated
|
||||||
|
* conference ID.
|
||||||
|
* @param {string} mucURL - In which MUC the conference exists.
|
||||||
* @returns {Promise} - The promise created by the request. The returned numbers
|
* @returns {Promise} - The promise created by the request. The returned numbers
|
||||||
* may be an array of numbers or an object with countries as keys and arrays of
|
* may be an array of numbers or an object with countries as keys and arrays of
|
||||||
* phone number strings.
|
* phone number strings.
|
||||||
*/
|
*/
|
||||||
export function getDialInNumbers(url: string): Promise<*> {
|
export function getDialInNumbers(
|
||||||
return doGetJSON(url);
|
url: string,
|
||||||
|
roomName: string,
|
||||||
|
mucURL: string
|
||||||
|
): Promise<*> {
|
||||||
|
|
||||||
|
const fullUrl = `${url}?conference=${roomName}@${mucURL}`;
|
||||||
|
|
||||||
|
return doGetJSON(fullUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -442,7 +452,7 @@ export function getShareInfoText(
|
||||||
}
|
}
|
||||||
|
|
||||||
numbersPromise = Promise.all([
|
numbersPromise = Promise.all([
|
||||||
getDialInNumbers(dialInNumbersUrl),
|
getDialInNumbers(dialInNumbersUrl, room, mucURL),
|
||||||
getDialInConferenceID(dialInConfCodeUrl, room, mucURL)
|
getDialInConferenceID(dialInConfCodeUrl, room, mucURL)
|
||||||
]).then(([ { defaultCountry, numbers }, {
|
]).then(([ { defaultCountry, numbers }, {
|
||||||
conference, id, message } ]) => {
|
conference, id, message } ]) => {
|
||||||
|
|
Loading…
Reference in New Issue