Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions react/features/invite/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,15 @@ export function getDialInConferenceID(
* phone number strings, as the second one should not be used and is deprecated.
*/
export function getDialInNumbers(
url: string,
roomName: string,
mucURL: string
url?: string,
roomName?: string,
mucURL?: string
): Promise<any> {

if (!url || !roomName || !mucURL) {
return Promise.resolve();
}

const separator = url.includes('?') ? '&' : '?';

// when roomName and mucURL are available
Expand Down
5 changes: 3 additions & 2 deletions react/features/invite/actions.any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import {
import { INVITE_TYPES } from './constants';
import {
invitePeopleAndChatRooms,
inviteSipEndpoints
inviteSipEndpoints,
isDialInEnabled
} from './functions';
import logger from './logger';
import { IInvitee } from './types';
Expand Down Expand Up @@ -210,7 +211,7 @@ export function updateDialInNumbers() {
const { numbersFetched } = state['features/invite'];
const mucURL = hosts?.muc;

if (numbersFetched || !dialInConfCodeUrl || !dialInNumbersUrl || !mucURL) {
if (numbersFetched || !isDialInEnabled(state)) {
// URLs for fetching dial in numbers not defined
return;
}
Expand Down
22 changes: 21 additions & 1 deletion react/features/invite/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,26 @@ export function isDialOutEnabled(state: IReduxState): boolean {
return isJwtFeatureEnabled(state, MEET_FEATURES.OUTBOUND_CALL, false) && conference?.isSIPCallingSupported();
}

/**
* Determines if dial out is currently enabled or not.
*
* @param {IReduxState} state - Current state.
* @returns {boolean} Indication of whether dial out is currently enabled.
*/
export function isDialInEnabled(state: IReduxState): boolean {
const dialInDisabled = state['features/base/conference']
.conference?.getMetadataHandler()?.getMetadata()?.dialinEnabled === false;

if (dialInDisabled) {
return false;
}

const { dialInConfCodeUrl, dialInNumbersUrl, hosts } = state['features/base/config'];
const mucURL = hosts?.muc;

return Boolean(dialInConfCodeUrl && dialInNumbersUrl && mucURL);
}

/**
* Determines if inviting sip endpoints is enabled or not.
*
Expand Down Expand Up @@ -634,7 +654,7 @@ export function getShareInfoText(
const { locationURL = {} } = state['features/base/connection'];
const mucURL = hosts?.muc;

if (skipDialIn || !dialInConfCodeUrl || !dialInNumbersUrl || !mucURL) {
if (skipDialIn || !isDialInEnabled(state)) {
// URLs for fetching dial in numbers not defined.
return Promise.resolve(infoText);
}
Expand Down