@@ -11,6 +11,7 @@ import type { InsertionModel } from '@rocket.chat/model-typings';
1111import { MediaCallNegotiations , MediaCalls } from '@rocket.chat/models' ;
1212
1313import { getCastDirector , getMediaCallServer } from './injection' ;
14+ import { DEFAULT_CALL_FEATURES } from '../constants' ;
1415import type { IMediaCallAgent } from '../definition/IMediaCallAgent' ;
1516import type { IMediaCallCastDirector } from '../definition/IMediaCallCastDirector' ;
1617import type { InternalCallParams , MediaCallHeader } from '../definition/common' ;
@@ -79,7 +80,7 @@ class MediaCallDirector {
7980 this . scheduleExpirationCheckByCallId ( call . _id ) ;
8081
8182 const updatedCall = await MediaCalls . findOneById ( call . _id , { projection : { features : 1 } } ) ;
82- const features = ( updatedCall ?. features || [ 'audio' ] ) as CallFeature [ ] ;
83+ const features = ( updatedCall ?. features || DEFAULT_CALL_FEATURES ) as CallFeature [ ] ;
8384
8485 await calleeAgent . onCallAccepted ( call . _id , { signedContractId : data . calleeContractId , features } ) ;
8586 await calleeAgent . oppositeAgent ?. onCallAccepted ( call . _id , { signedContractId : call . caller . contractId , features } ) ;
@@ -177,17 +178,7 @@ class MediaCallDirector {
177178 }
178179
179180 public async createCall ( params : CreateCallParams ) : Promise < IMediaCall > {
180- const {
181- caller,
182- callee,
183- requestedCallId,
184- requestedService,
185- callerAgent,
186- calleeAgent,
187- parentCallId,
188- requestedBy,
189- features = [ 'audio' ] ,
190- } = params ;
181+ const { caller, callee, requestedCallId, requestedService, callerAgent, calleeAgent, parentCallId, requestedBy, features } = params ;
191182
192183 // The caller must always have a contract to create the call
193184 if ( ! caller . contractId ) {
0 commit comments