Skip to content

Releases: twilio/twilio-voice.js

2.8.0

16 Oct 18:15
Compare
Choose a tag to compare

2.8.0 (October 16, 2023)

New Features

  • Added a new feature flag enableImprovedSignalingErrorPrecision to enhance the precision of errors emitted by Device and Call objects.

    const token = ...;
    const device = new Device(token, {
      enableImprovedSignalingErrorPrecision: true,
    });

    The default value of this option is false.

    When this flag is enabled, some errors that would have been described with a generic error code are now described with a more precise error code. With this feature, the following errors now have their own error codes. Please see this page for more details about each error.

    • Device Error Changes

      const device = new Device(token, {
        enableImprovedSignalingErrorPrecision: true,
      });
      device.on('error', (deviceError) => {
        // the following table describes how deviceError will change with this feature flag
      });
      Device Error Name Device Error Code with Feature Flag Enabled Device Error Code with Feature Flag Disabled
      GeneralErrors.ApplicationNotFoundError 31001 53000
      GeneralErrors.ConnectionDeclinedError 31002 53000
      GeneralErrors.ConnectionTimeoutError 31003 53000
      MalformedRequestErrors.MissingParameterArrayError 31101 53000
      MalformedRequestErrors.AuthorizationTokenMissingError 31102 53000
      MalformedRequestErrors.MaxParameterLengthExceededError 31103 53000
      MalformedRequestErrors.InvalidBridgeTokenError 31104 53000
      MalformedRequestErrors.InvalidClientNameError 31105 53000
      MalformedRequestErrors.ReconnectParameterInvalidError 31107 53000
      SignatureValidationErrors.AccessTokenSignatureValidationFailed 31202 53000
      AuthorizationErrors.NoValidAccountError 31203 53000
      AuthorizationErrors.JWTTokenExpirationTooLongError 31207 53000
      ClientErrors.NotFound 31404 53000
      ClientErrors.TemporarilyUnavilable 31480 53000
      ClientErrors.BusyHere 31486 53000
      SIPServerErrors.Decline 31603 53000
    • Call Error Changes

      const device = new Device(token, {
        enableImprovedSignalingErrorPrecision: true,
      });
      const call = device.connect(...);
      call.on('error', (callError) => {
        // the following table describes how callError will change with this feature flag
      });
      Call Error Name Call Error Code with Feature Flag Enabled Call Error Code with Feature Flag Disabled
      GeneralErrors.ConnectionDeclinedError 31002 31005
      AuthorizationErrors.InvalidJWTTokenError 31204 31005
      AuthorizationErrors.JWTTokenExpiredError 31205 31005

    IMPORTANT: If your application logic currently relies on listening to the generic error code 53000 or 31005, and you opt into enabling the feature flag, then your applicaton logic needs to be updated to anticipate the new error code when any of the above errors happen.

2.7.3

06 Oct 18:00
Compare
Choose a tag to compare

2.7.3 (October 6, 2023)

Bug Fixes

  • Fixed an issue where, sometimes a TypeError is raised while handling an incoming call under the following circumstances:
    • Network interruptions
    • updating the token before accepting the call

2.7.2

21 Sep 19:46
Compare
Choose a tag to compare

2.7.2 (September 21, 2023)

Changes

  • Fixed an issue where audio in the Chrome browser is choppy when another application is also using the audio devices.
  • Added missing documentation for the following events:
    • call.on('ringing', handler)
    • call.on('warning', handler)
    • call.on('warning-cleared', handler)
    • device.on('destroyed', handler)

2.7.1

03 Aug 23:00
Compare
Choose a tag to compare

2.7.1 (August 3, 2023)

Bug Fixes

  • Fixed an issue where call.sendMessage() API throws an error if the SDK is imported as an ECMAScript Module (ESM) using the @twilio/voice-sdk/esm path.

2.7.0

01 Aug 20:51
Compare
Choose a tag to compare

2.7.0 (August 1, 2023)

ECMAScript Module Support

Currently, the SDK is imported as a CommonJS Module (CJS) using the root path @twilio/voice-sdk. With this release, the SDK contains an experimental feature that allows it to be imported as an ECMAScript Module (ESM) using the @twilio/voice-sdk/esm path. As this is an experimental feature, some frameworks using bundlers like Vite and Rollup may not work. Full support for ESM will be available in a future release and will become the default import behavior of the SDK.

Example:

import { Device } from '@twilio/voice-sdk/esm';

2.6.1

07 Jul 17:24
Compare
Choose a tag to compare

2.6.1 (July 7, 2023)

Changes

  • Fixed some security vulnerabilities shown by npm audit.
  • Removed unused dependencies.
  • Replaced deprecated dependencies.

Bug Fixes

  • Fixed an issue where custom DTMF sounds would not play. With this release, custom DTMF sounds should now play when configured during device initialization.

    const device = new Device(token, {
      sounds: {
        dtmf8: 'http://mysite.com/8_button.mp3',
        // Other custom sounds
      },
      // Other options
    });
  • Fixed an issue where calling device.updateOptions would reset the device.audio._enabledSounds state.

2.6.0

20 Jun 21:55
Compare
Choose a tag to compare

2.6.0 (June 20, 2023)

Changes

  • The SDK now builds on NodeJS versions 16 and above without the --legacy-peer-deps flag.
  • Removed usage of NodeJS modules from the SDK and some dependencies. With this change, the SDK should now work with some of the latest frameworks that use the latest versions of bundlers such as Vite and Webpack.
  • The AudioPlayer dependency has been incorporated into the SDK as part of a migration. This change fixes an issue where source maps are not properly loaded.
  • Removed unnecessary files from the generated npm package.
  • Links to source maps are now included in the generated npm package.
  • The ws package has been moved to devDependencies.
  • The SDK no longer depends on the xmlhttprequest npm package.

2.5.0

09 May 21:12
Compare
Choose a tag to compare

2.5.0 (May 9, 2023)

New Features

WebRTC API Overrides (Beta)

The SDK now allows you to override WebRTC APIs using the following options and events. If your environment supports WebRTC redirection, such as Citrix HDX's WebRTC redirection technologies, your application can use this new beta feature for improved audio quality in those environments.

2.4.0

06 Apr 21:08
Compare
Choose a tag to compare

2.4.0 (April 6, 2023)

Changes

  • Updated the description of Device.updateToken API. It is recommended to call this API after Device.tokenWillExpireEvent is emitted, and before or after a call to prevent a potential ~1s audio loss during the update process.

  • Updated stats reporting to stop using deprecated RTCIceCandidateStats - ip and deleted.

Bug Fixes

  • Fixed an issue where a TypeError is thrown after rejecting a call then invoking updateToken.

  • Fixed an issue (#87, #145) where the PeerConnection object is not properly disposed.

  • Fixed an issue where device.audio.disconnect, device.audio.incoming and device.audio.outgoing do not have the correct type definitions.

  • Fixed an issue where the internal deviceinfochange event is being emitted indefinitely, causing high cpu usage.

2.3.2

27 Feb 18:45
Compare
Choose a tag to compare

2.3.2 (February 27, 2023)

Bug Fixes