chore: use a separate license module for team collab VoIP and omnichannel VoIP (#33604)

feat/sidebar-collapser^2
Pierre Lehnen 2 years ago committed by GitHub
parent 15582b1026
commit bd64aedba8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      apps/meteor/ee/app/api-enterprise/server/index.ts
  2. 16
      apps/meteor/ee/app/api-enterprise/server/voip-freeswitch.ts
  3. 2
      apps/meteor/ee/server/configuration/voip.ts
  4. 2
      apps/meteor/ee/server/settings/voip.ts
  5. 1
      packages/i18n/src/locales/en.i18n.json

@ -4,6 +4,6 @@ await License.onLicense('canned-responses', async () => {
await import('./canned-responses');
});
await License.onLicense('voip-enterprise', async () => {
License.onValidateLicense(async () => {
await import('./voip-freeswitch');
});

@ -16,6 +16,10 @@ API.v1.addRoute(
{ authRequired: true, permissionsRequired: ['manage-voip-extensions'], validateParams: isVoipFreeSwitchExtensionListProps },
{
async get() {
if (!settings.get('VoIP_TeamCollab_Enabled')) {
throw new Error('error-voip-disabled');
}
const { username, type = 'all' } = this.queryParams;
const extensions = await wrapExceptions(() => VoipFreeSwitch.getExtensionList()).catch(() => {
@ -58,6 +62,10 @@ API.v1.addRoute(
{ authRequired: true, permissionsRequired: ['manage-voip-extensions'], validateParams: isVoipFreeSwitchExtensionAssignProps },
{
async post() {
if (!settings.get('VoIP_TeamCollab_Enabled')) {
throw new Error('error-voip-disabled');
}
const { extension, username } = this.bodyParams;
if (!username) {
@ -89,6 +97,10 @@ API.v1.addRoute(
{ authRequired: true, permissionsRequired: ['view-voip-extension-details'], validateParams: isVoipFreeSwitchExtensionGetDetailsProps },
{
async get() {
if (!settings.get('VoIP_TeamCollab_Enabled')) {
throw new Error('error-voip-disabled');
}
const { extension, group } = this.queryParams;
if (!extension) {
@ -115,6 +127,10 @@ API.v1.addRoute(
{ authRequired: true, permissionsRequired: ['view-user-voip-extension'], validateParams: isVoipFreeSwitchExtensionGetInfoProps },
{
async get() {
if (!settings.get('VoIP_TeamCollab_Enabled')) {
throw new Error('error-voip-disabled');
}
const { userId } = this.queryParams;
if (!userId) {

@ -4,7 +4,7 @@ import { Meteor } from 'meteor/meteor';
import { addSettings } from '../settings/voip';
Meteor.startup(async () => {
await License.onLicense('voip-enterprise', async () => {
License.onValidateLicense(async () => {
await addSettings();
});
});

@ -5,7 +5,7 @@ export function addSettings(): Promise<void> {
await this.with(
{
enterprise: true,
modules: ['voip-enterprise'],
modules: ['teams-voip'],
},
async function () {
await this.add('VoIP_TeamCollab_Enabled', false, {

@ -2244,6 +2244,7 @@
"error-registration-not-found": "Registration information not found",
"error-extension-not-available": "Extension not available",
"error-user-not-found": "User not found",
"error-voip-disaled": "Team voice calls (VoIP) is disabled",
"error-extension-not-assigned": "Extension not assigned",
"Workspace_exceeded_MAC_limit_disclaimer": "The workspace has exceeded the monthly limit of active contacts. Talk to your workspace admin to address this issue.",
"You_do_not_have_permission_to_do_this": "You do not have permission to do this",

Loading…
Cancel
Save