diff --git a/react/features/invite/actions.js b/react/features/invite/actions.js index 8973c07ba..bd4142c5a 100644 --- a/react/features/invite/actions.js +++ b/react/features/invite/actions.js @@ -11,7 +11,6 @@ import { import { getDialInConferenceID, getDialInNumbers, - getDigitsOnly, invitePeopleAndChatRooms } from './functions'; @@ -65,7 +64,7 @@ export function invite(invitees: Array) { // For each number, dial out. On success, remove the number from // {@link invitesLeftToSend}. const phoneInvitePromises = phoneNumbers.map(item => { - const numberToInvite = getDigitsOnly(item.number); + const numberToInvite = item.number; return conference.dial(numberToInvite) .then(() => { diff --git a/react/features/invite/functions.js b/react/features/invite/functions.js index 3ae3447d0..9de54cdd1 100644 --- a/react/features/invite/functions.js +++ b/react/features/invite/functions.js @@ -20,17 +20,6 @@ export function checkDialNumber( dialNumber: string, dialOutAuthUrl: string ): Promise { - - if (!dialOutAuthUrl) { - // no auth url, let's say it is valid - const response = { - allow: true, - phone: `+${dialNumber}` - }; - - return Promise.resolve(response); - } - const fullUrl = `${dialOutAuthUrl}?phone=${dialNumber}`; return new Promise((resolve, reject) => { @@ -159,10 +148,18 @@ export function getInviteResultsForQuery( } - const hasCountryCode = text.startsWith('+'); + let hasCountryCode = text.startsWith('+'); let phoneNumberPromise; - if (dialOutEnabled && isMaybeAPhoneNumber(text)) { + // Phone numbers are handled a specially to enable both cases of restricting + // numbers to telephone number-y numbers and accepting any arbitrary string, + // which may be valid for SIP (jigasi) calls. If the dialOutAuthUrl is + // defined, then it is assumed the call is to a telephone number and + // some validation of the number is completed, with the + sign used as a way + // for the UI to detect and enforce the usage of a country code. If the + // dialOutAuthUrl is not defined, accept anything because this is assumed + // to be the SIP (jigasi) case. + if (dialOutEnabled && dialOutAuthUrl && isMaybeAPhoneNumber(text)) { let numberToVerify = text; // When the number to verify does not start with a +, we assume no @@ -178,6 +175,16 @@ export function getInviteResultsForQuery( numberToVerify = getDigitsOnly(numberToVerify); phoneNumberPromise = checkDialNumber(numberToVerify, dialOutAuthUrl); + } else if (dialOutEnabled && !dialOutAuthUrl) { + // fake having a country code to hide the country code reminder + hasCountryCode = true; + + // With no auth url, let's say the text is a valid number + phoneNumberPromise = Promise.resolve({ + allow: true, + country: '', + phone: text + }); } else { phoneNumberPromise = Promise.resolve({}); }