メニュー

Expand
Rate this page:

Thanks for rating this page!

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

Twilio Client JS SDK: Twilio in the browser

Attention: Please upgrade to the latest version of twilio.js to avoid breaking changes. Google Chrome will introduce these changes by the end of 2019. Versions prior to 1.7.1 will be impacted. See this advisory for details.

概要

The Twilio Client JS SDK (twilio.js) allows you to make voice calls to and from a web browser and a Twilio TwiML Voice Application. This means you can open inbound and outbound audio connections to Twilio for building softphones, walkie-talkies, conference calls, click-to-talk systems, and more, all from the browser.

すぐに始めてみますか? Twilio クライアント クイックスタートで、今すぐ使ってみましょう!

動作のしくみ

デバイスを設定して、Twilio との接続を確立します。 デバイスのマイクから音声が Twilio に送信されます。Twilio からの音声はデバイスのスピーカーで再生されます。通常の電話と同じです。 ただし、Twilio クライアントでは、デバイスは電話でなくても構いません。

Client Connection Overview

When you initiate a connection using Twilio Client, you're not connecting to another phone directly. Rather, you're connecting to Twilio and instructing Twilio to fetch TwiML from your server to handle the connection. This is analogous to the way Twilio handles incoming calls from a real phone. All the same TwiML verbs and nouns that are available for handling Twilio Voice calls are also available for handling Twilio Client connections. We've also added a new <Client> noun for dialing to a Client.

Twilio アプリケーション

Twilio クライアントは、特定の電話番号への接続に対してのみに作られているわけではないため、Twilio がサーバーとどのように接続するかは、ご自身のアカウントに登録された Twilio アプリケーション 側で決定されます。 Twilio アプリケーションは、電話番号の VoiceUrlSmsUrl などの、URL のセットを保存する簡単な方法ですが、これらの URL は 1 つの電話番号に限定されません。 このため、Twilio クライアントからの接続には、Twilio アプリケーションはお勧めの方法です (実は、この部分を最初に作成したのは、その理由からです)。

So when your device initiates a Twilio Client connection to Twilio, a request is made to the VoiceUrl property of an Application within your account. You specify the Application you're connecting to with an Access Token. Twilio uses the TwiML response from its request to that Application's VoiceUrl to direct what happens with the Client connection.

サポートされるブラウザー

The following table indicates the browsers supported by Twilio Client JS. We support the most recent (N) and the two previous (N-2) versions of these browsers unless otherwise indicated.

Chrome Firefox Safari** Edge (ORTC*** & Chromium)
Android - -
iOS * * -
Linux - -
macOS -
Windows -

Mobile browsers lack the ability to receive or maintain call connectivity whilst in the background and they do not allow GSM call interruption handling. These lead to poor user experience. To create the best user experience, Twilio recommends understanding these limitations when creating mobile Voice Applications. Twilio also recommends evaluating the iOS and Android SDKs for creating mobile Voice Applications.

* Chrome and Firefox for iOS do not have access to WebRTC APIs, unlike Safari for iOS.

** WebRTC support in Safari started with Safari version 11

*** We recommend migrating to the new Chromium Edge as soon as possible as we will stop supporting ORTC in the near future

Electron Support

Twilio Client JS is also supported on the latest Electron version

セキュリティ

Channel Type
Signaling TLS
Media SRTP

Current Twilio.js Releases

As of 1.3, Twilio.js has been strictly following SemVer: minor-level updates only contain feature updates and are completely backward compatible with 1.3.0 and newer. Documentation for the current Twilio.js SDK API can be found here.

Deprecated Twilio.js Releases

Support for Twilio.js 1.1 and 1.2 ceased on February 14, 2018.

Please use the Migration Guide to upgrade to the newest version of Twilio.js.

Rate this page:

ヘルプが必要ですか?

誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。