Starting a Call

All calls start from one of the following methods:

With either approach, a Twilio Room is created and call:incoming events are sent to other members of the call. Each member is given 60 seconds to answer or decline the call. If no members join after 60 seconds, the call will automatically end and the current user will receive a call:closed event which should trigger the clearing of all call related state.

The calls.start() and calls.startWithGroup() methods will return a Promise<Call> object. Once resolved, the Call object will contain the Twilio Room. Use this room to publish the user's audio and video tracks to all room participants.

Example

const call = await client.calls.start({
organizationId: 'some-org-id',
networkType: 'provider',
participantIds: ['some-user-id-1', 'some-user-id-2'],
});
console.log('New Twilio Room', call.room);