MrHertal / react-native-twilio-phone

Twilio Voice React Native module.
MIT License
154 stars 67 forks source link

[Enhance] `startCall` function of RNTwilioPhone should allow pass additional params #51

Closed trieuduongle closed 3 years ago

trieuduongle commented 3 years ago

Hi @MrHertal ,

As you can see from the image,

image

params could be an object that accept any value (not only 2 params as currently: "from" and "to"), and Twilio functions can use these params to serve its request.

So I think we should update the parameter for startCall function, it should look like this, I think.

static async startCall(to: string, calleeName?: string, from?: string, additionalParams: ConnectParams = {})

If you think that this is correct, could you help me update it?

MrHertal commented 3 years ago

Hi 👋

I guess you are right, you can either submit a PR to make this change or use the lower API method TwilioPhone.startCall directly.

Thanks

trieuduongle commented 3 years ago

@MrHertal I created a pull request for it. https://github.com/MrHertal/react-native-twilio-phone/pull/53

To avoid modify previous code too much, I just use spread operator to merge your "params" with my "additionalParams"

MrHertal commented 3 years ago

Thanks @trieuduongle :)

I will review it asap.

MrHertal commented 3 years ago

I just merged your PR and made a new release. Thanks