Releases: twilio/twilio-voice.js
2.12.2
2.12.1
2.12.0
2.12.0 (August 26, 2024)
New Features
Call Message Events
The Call Message Events, originally released in 2.2.0, has been promoted to GA. This release includes the following breaking changes.
- Call.Message.messageType has been converted from
Call.MessageType
enum tostring
. - Call Message related errors are now emitted via call.on('error', handler(twilioError)) instead of device.on('error', handler(twilioError)).
- A new error, 31210, has been added to the SDK. This new error is emitted via call.on('error', handler(twilioError)) after calling the sendMessage API with an invalid Call.Message.messageType.
- Fixed an issue where the wrong error code
31209
is raised if the payload size of a Call Message Event exceeds the authorized limit. With this release,31212
is raised instead.
2.11.3
2.11.3 (August 21, 2024)
Bug Fixes
- Fixed an issue where
PreflightTest
throws an error whenRTCIceCandidateStatsReport
is not available. Thanks @phi-line for your contribution.
Improvements
- The SDK now updates its internal device list when the microphone permission changes.
2.11.2
2.11.2 (June 26, 2024)
- Fixed an issue where an
AcquisitionFailedError
is raised when making a call while asetInputDevice
invocation is still in progress. The following snippet will reproduce the issue.// Call setInputDevice without waiting for it to resolve e.g. using 'await' device.audio.setInputDevice(id); // Calling device.connect immediately raises an AcquisitionFailedError error device.connect(...);
2.11.1
2.11.1 (May 30, 2024)
Bug Fixes
-
Fixed an issue where the input stream stops working after changing the default input device. Thanks @varunm0503 for your contribution.
-
Fixed an echo issue where the audio output is duplicated after the device permission is granted. Thanks @kmteras for your contribution.
2.11.0
2.11.0 (May 2, 2024)
New Features
Chrome Extensions Manifest V3 Support
In Manifest V2, Chrome Extensions have the ability to run the Voice JS SDK in the background when making calls. But with the introduction of Manifest V3, running the Voice JS SDK in the background can only be achieved through service workers. Service workers don't have access to certain features such as DOM, getUserMedia, and audio playback, making it impossible to make calls with previous versions of the SDK.
With this new release, the SDK can now run in a service worker context to listen for incoming calls or initiate outgoing calls. When the call object is created, it can be forwarded to an offscreen document where the SDK has access to all the necessary APIs to fully establish the call. Check our example to see how this works.
Client side incoming call forwarding and better support for simultaneous calls
Prior versions of the SDK support simultaneous outgoing and incoming calls using different identities. If an incoming call comes in and the Device
with the same identity is busy, the active call needs to be disconnected before accepting the incoming call. With this new release of the SDK, multiple incoming calls for the same identity can now be accepted, muted, or put on hold, without disconnecting any existing active calls. This can be achieved by forwarding the incoming call to a different Device
instance. See the following new APIs and example for more details.
New APIs
Example
// Create a Device instance that handles receiving of all incoming calls for the same identity.
const receiverDevice = new Device(token, options);
await receiverDevice.register();
receiverDevice.on('incoming', (call) => {
// Forward this call to a new Device instance using the call.connectToken string.
forwardCall(call.connectToken);
});
// The forwardCall function may look something like the following.
async function forwardCall(connectToken) {
// For every incoming call, we create a new Device instance which we can
// interact with, without affecting other calls.
// IMPORTANT: The token for this new device needs to have the same identity
// as the token used in the receiverDevice.
const device = new Device(token, options);
const call = await device.connect({ connectToken });
// Destroy the device after the call is completed
call.on('disconnect', () => device.destroy());
}
2.10.2
2.10.1
2.10.1 (January 12, 2024)
Bug Fixes
- Fixed an issue where
device.register()
does not return a promise rejection when the WebSocket fails to connect. Thank you @kamalbennani for your contribution. - Fixed an issue where audio processor insights events are not generated if there is an existing processed stream at the start of a call.
2.10.0
2.10.0 (January 5, 2024)
Improvements
- Added tags to client logs for easier filtering
- Added log statements to API calls and events for debugging purposes
Bug Fixes
- Fixed an issue where updating token after signaling connection has gone offline causes an Invalid State error.
- Fixed an issue where
Device.Options.logLevel
is only accepting anumber
type. With this release,strings
are now also allowed. See Device.Options.logLevel for a list of possible values. - Fixed an issue where
call.mute()
does not have an effect while thecall.status()
is eitherringing
orconnecting
. Thank you @zyzmoz for your contribution.