Troubleshooting Common Problems with the Twilio Voice JavaScript SDK

In this article you will find troubleshooting steps for resolving some of the most common problems we see for apps built using the The Twilio Voice JavaScript SDK (formerly "Twilio Client"). This guide covers the following issues:

Notice: Prior to going live with a Twilio Voice JS SDK application, we recommend reviewing the following checklist:

  • Open network ports in your router / firewall / antivirus software. For full details, see Voice SDKs Network Connectivity Requirements.
  • If your router supports QoS, prioritize the ports mentioned above, or the IP address of the computer(s) making Voice SDK calls.
  • Run the test at http://networktest.twilio.com. This will test two-way audio, and report how many simultaneous calls your connection can support.

For more information, see Twilio Voice JavaScript SDK Deployment Best Practices.

Unable to establish a call

  • Check open network ports in your router / firewall / antivirus software
  • Confirm a network connection is currently available
  • Review the javascript console for application errors

No audio or one-way audio

  • Check open network ports in your router / firewall / antivirus software
  • Confirm the hardware is correctly attached and ensure the correct microphone and speakers are selected in software settings
  • Check to ensure the microphone is not muted (some have a hardware mute button) and the speaker volume is turned up

Call audio cutting out or stops transmitting

  • Twilio Voice requires a high speed and low latency network connection. Benchmark the network by testing your throughput and ping at speedtest.net and aim to improve the scores.
  • Enable router QoS or prioritize traffic for Twilio Voice.
  • Reduce network activity not related to VoIP or use a separate network for VoIP workstations.
  • Try using a wired connection or move closer to your wi-fi router or base station. Connection jitter or packet loss can produce choppy or "robotic" sounding call audio.

Call audio is garbled or contains artifacts

  • Use a headset instead of built in computer microphone.
  • Reduce ambient noise such as nearby speakers or fans.
  • Adjust the distance of the microphone from the mouth - too close can cause audio clipping.
  • Adjust microphone levels in the computer’s sound settings.
  • Ensure computer has resources available to process a call.
    • CPU and RAM are not over-utilized
    • Close un-needed applications and browser tabs
    • Try disabling antivirus software
  • Try using a wired connection or move closer to your wi-fi router or base station. Connection jitter or packet loss can produce choppy or "robotic" sounding call audio.

Microphone level is changing on its own

Some device drivers do not behave properly for auto-gain control. If you have noticed that your microphone level is self-adjusting, consider overriding the WebRTC defaults in order to force the AGC to be turned off, regardless of system wide settings. You can do this by specifying googAutoGainControl when calling the setup function, as follows:

Twilio.Device.setup(token, {
    audioConstraints: {
        mandatory: { 
            googAutoGainControl: false 
        } 
    } 
});

For the complete list of audioConstraints, please refer to the FAQ How to constrain the audio sources in Google Chrome?.

Have more questions? Submit a request
Powered by Zendesk