Skip to content

Commit 472ca45

Browse files
feat: voice to video escalation
1 parent cad1c1b commit 472ca45

70 files changed

Lines changed: 2272 additions & 221 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/meteor/ee/server/settings/voip.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,18 @@ export function addSettings(): Promise<void> {
8282
invalidValue: 5060,
8383
});
8484
});
85+
86+
await this.section('VoIP_TeamCollab_AdvancedFeatures', async function () {
87+
const enableQuery = { _id: 'Pexip_Integration_Enabled', value: true };
88+
89+
await this.add('VoIP_TeamCollab_Video_Escalation_Enabled', false, {
90+
type: 'boolean',
91+
public: true,
92+
invalidValue: false,
93+
enableQuery,
94+
i18nDescription: 'VoIP_TeamCollab_Video_Escalation_Enabled_Description',
95+
});
96+
});
8597
},
8698
);
8799
});

apps/meteor/server/api/v1/media-calls.ts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,76 @@ declare module '@rocket.chat/rest-typings' {
9898
interface Endpoints extends MediaCallsAnswerEndpoints {}
9999
}
100100

101+
type MediaCallsEscalate = {
102+
callId: string;
103+
};
104+
105+
const MediaCallsEscalateSchema: JSONSchemaType<MediaCallsEscalate> = {
106+
type: 'object',
107+
properties: {
108+
callId: {
109+
type: 'string',
110+
},
111+
},
112+
required: ['callId'],
113+
additionalProperties: false,
114+
};
115+
116+
export const isMediaCallsEscalateProps = ajv.compile<MediaCallsEscalate>(MediaCallsEscalateSchema);
117+
118+
const mediaCallsEscalateEndpoints = API.v1.post(
119+
'media-calls.escalate',
120+
{
121+
response: {
122+
200: ajv.compile<{
123+
providerName: string;
124+
url: string;
125+
}>({
126+
additionalProperties: false,
127+
type: 'object',
128+
properties: {
129+
providerName: {
130+
type: 'string',
131+
description: 'The name of the conference provider.',
132+
},
133+
url: {
134+
type: 'string',
135+
description: 'The url of the conference.',
136+
},
137+
success: {
138+
type: 'boolean',
139+
description: 'Indicates if the request was successful.',
140+
},
141+
},
142+
required: ['providerName', 'url', 'success'],
143+
}),
144+
400: validateBadRequestErrorResponse,
145+
401: validateUnauthorizedErrorResponse,
146+
403: validateForbiddenErrorResponse,
147+
404: validateNotFoundErrorResponse,
148+
},
149+
body: isMediaCallsEscalateProps,
150+
authRequired: true,
151+
},
152+
async function action() {
153+
const { callId } = this.bodyParams;
154+
155+
const url = await MediaCall.escalateCall(this.userId, { callId });
156+
157+
return API.v1.success({
158+
providerName: 'core.pexip',
159+
url,
160+
});
161+
},
162+
);
163+
164+
type MediaCallsEscalateEndpoints = ExtractRoutesFromAPI<typeof mediaCallsEscalateEndpoints>;
165+
166+
declare module '@rocket.chat/rest-typings' {
167+
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-interface
168+
interface Endpoints extends MediaCallsEscalateEndpoints {}
169+
}
170+
101171
type MediaCallsStateSignalsParams = {
102172
contractId: string;
103173
};

0 commit comments

Comments
 (0)