Menu

Expand
Rate this page:

Twilio Voice JavaScript SDK Edge Locations

The Twilio Client JavaScript SDK has been renamed to Twilio Voice JavaScript SDK.

Twilio Voice JavaScript SDK lets you select the specific Twilio data center edge locations used when your Twilio Device connects to Twilio. Network communication to and from Twilio will originate/terminate from the fixed, static IP address ranges listed for each edge location. Refer to these ranges if you need to configure your local network to allow communication or apply Quality of Service routing rules to communication with Twilio.

Twilio edge locations were added in version 1.11. Prior releases used a parameter named region that has now been deprecated.

Edge Location information for Twilio Voice JavaScript SDK

By default, the Twilio Voice JavaScript SDK will use Twilio's Global Low Latency (the roaming edge location) routing capability to determine which data center is closest to your user, establishing a connection through Twilio's nearest point of presence.

Global Low Latency uses latency-based DNS lookups to determine the nearest data center. You may want to override this in some cases, especially when your users are working from a fixed location and using a DNS server in another edge location.

GLL (roaming edge location) requires the upstream DNS to support RFC 7871. See GLL requirements for more information.

If you are operating a restricted network that requires allowing of media IPs, our recommendation is to specify the edge location in your application. Twilio will continue to expand our Global Low Latency (the roaming edge location) footprint in the future by adding more edges with different IP ranges and leaving the edge selection up to Global Low Latency could result in connections being established to edges that are not allowed by your infrastructure which may result in one-way audio or call set up failures.

Use any one of the available edge locations as the edge parameter. Leaving the value undefined will cause Twilio to default to its Global Low Latency routing, which cause the Device to establish its connection to the Twilio edge closest to the user.

Edges

For connectivty and bandwidth requirements including IP address list and ports see Voice Platform SDKs’ Network Connectivity Requirements

Example Usage

The examples below show two methods for setting an edge location.

Option 1 instantiates a new Twilio.Device with token and options arguments.

Option 2 instantiates a new Twilio.Device without the options argument. With this method, you can update the device options with device.updateOptions(options).

Force connections through Twilio Ireland:

Option 1:

const device = new Twilio.Device(token, { edge: "dublin" });

Option 2:

const device = new Twilio.Device(token);
device.updateOptions({ edge: "dublin" });

Force connections through Twilio US East Coast edge over your private Interconnect connection to that edge:

Option 1:

const device = new Twilio.Device(token, { edge: "ashburn-ix" });

Option 2:

const device = new Twilio.Device(token);
device.updateOptions({ edge: "ashburn-ix"});

Let Twilio choose the nearest edge:

const device = new Twilio.Device(token);

See the Twilio.Device documentation for more information.

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Community Forums or browsing the Twilio tag on Stack Overflow.

        
        
        

        Thank you for your feedback!

        We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        Step 1

        Get link

        Get a free personal referral link here

        Step 2

        Give $10

        Your user signs up and upgrade using link

        Step 3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more