From ecb69ec166156e147e4826df9e83a5a3eda82d8a Mon Sep 17 00:00:00 2001 From: trieuduongle Date: Fri, 20 Aug 2021 13:41:05 +0700 Subject: [PATCH] Allow passing additional params to startCall function (#53) --- src/RNTwilioPhone.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/RNTwilioPhone.ts b/src/RNTwilioPhone.ts index ad0ed42e..f8a5113c 100644 --- a/src/RNTwilioPhone.ts +++ b/src/RNTwilioPhone.ts @@ -113,7 +113,12 @@ class RNTwilioPhone { }); } - static async startCall(to: string, calleeName?: string, from?: string) { + static async startCall( + to: string, + calleeName?: string, + from?: string, + additionalParams: ConnectParams = {} + ) { const accessToken = await RNTwilioPhone.fetchAccessToken(); const params: ConnectParams = { to }; @@ -121,7 +126,10 @@ class RNTwilioPhone { params.from = from; } - TwilioPhone.startCall(accessToken, params); + TwilioPhone.startCall(accessToken, { + ...params, + ...additionalParams, + }); const uuid = ramdomUuid().toLowerCase(); RNTwilioPhone.activeCall = { uuid: null, sid: null };