メニュー

Expand
ページを評価:

音声通話のトラブルシューティング

デバッグツール

Twilio offers several tools for investigating the interaction between Twilio and your application. If a call fails to go through, or your voice call behaves unexpectedly, the Debugger and Request Inspector should be your first stops for debugging.

ログ

Found in your Twilio console, the Logs contain detailed log of activities within your application, from error logs to specific logs around the APIs you use. These logs can help you dive deeper and understand which Twilio resources were impacted (and by whom).

To get to the debugger, open the console navigation and toggle to the Monitor tab and select Logs to access your error logs:

To the right of the Develop tab in your console is the Monitor tab. When this tab is selected, you can click on "Logs" to expand log options, expand Errors to find Error Logs

Once in the error logs, you can dig into detailed logs, such as these HTTP retrieval failures, to understand the root cause of your problem.

A detailed view of the Error Logs in the Twilio console. We can see two red bar lines on a graph showing the dates of errors. Below this graph is a detailed list with specific errors, product, and timestamp.

アラートトリガー

Consoleでご自身のアラートトリガーを設定できます。 これらにより、お使いのアカウントでエラーが発生したとき、Webhookまたはメールによって通知されます。

Product-specific logs

The Twilio Console logs also provide you with information regarding the requests Twilio makes to your application and the responses Twilio receives. You will be able to access logs for any Twilio product you work with. Twilio keeps these logs for 90 days.

  • Twilioアカウントにログインします
  • Access your call logs by navigating the Monitor tab, expanding Logs, and clicking on the product you need to examine, like Calls or Messaging logs.

Navigate to Messaging logs via the Monitor tab in your Twilio Console, then click on "Logs" to open logs and select "Messaging"

A screenshot of Programmable Messaging Logs in the Twilio Console. We see fields for searching by Message SID, Start Fate & Time, End Date & Time, From, To, and Status. One log line shows a message sent with a service, with all available data and message status of "Canceled"

  • Once you’re in your voice logs, find the message where the problem occurred. Click the hyperlinked date to dig down into the details for this message.

Screenshot of Twilio console showing Messaging log details

これでリクエストを調査できます!

If any HTTP requests were logged for the event you're investigating, you will find the Request Inspector at the bottom of the page, where you can see all of the data, response headers, and any errors that may have been returned.

A detailed view of the messaging request inspector. We see the type of request (GET), the URL accessed, timestamp, and all available request and response data.

In the above screenshot, Twilio made a request to demo.twilio.com but failed to send the message to the end user due to an invalid phone number.

エラーコード

Twilioによって生成された全エラーコードはこちらにドキュメント化されています。 発生しているエラーコードを見つけて、原因と考えられる解決策を調べましょう。

一般的な諸問題

通話で「アプリケーションエラーが発生しました」という音声が流れる

「アプリケーションエラー」とは、開発者のサーバー上で指定されたURLからTwilioがフェッチしようとしたコードが使用できなかったか、コード中にエラーがあったかのどちらかを意味しています。 Console、または通話処理用のアプリケーションの命令の中で特定の電話番号に対するURLを確認できます。

Find the URL configured for use with a phone number in the phone numbers Console.

If you see this error, check your Twilio account's debugger logs for more details.

メモ: 開発者のサーバーがTwilioから公開インターネット経由で到達できるようにすることが必要です。 ローカル上で開発やテストを行っている場合、Webhookのテストにはngrokのご使用を推奨します。 こちらのガイドに従って、ngrokをTwilioで使用する方法を学習できます。

通話の着信を抑止する方法

If you do not want to receive any phone calls with your Twilio phone number, you must remove the Voice Request URL from your Twilio phone number and leave that field blank. Without a Voice Request URL, this phone number is considered 'out of service' for inbound calls. You will not be charged for any incoming calls, nor will these calls be received and logged in your account.

To reject phone calls coming from specific phone numbers, use the <Reject> verb. As long as <Reject> is the first verb in your response to the call, Twilio will not answer the call. If any other TwiML verbs are used before <Reject>, your application will receive the call and your account will be billed.

<Gather>に関する問題

<Gather>にまつわる問題の原因を特定できる決定的なテストは存在しません。 取るべき最善のアプローチとしては、考えうるすべてのことを試して問題の切り分けを行うことです。 下記をお試しください:

  1. Use several different phones from different carriers. If the issue occurs reliably, but only on phones from a particular carrier, you might want to contact that carrier directly to report the issue. If the problem occurs reliably on multiple telephones from multiple service providers, please contact Twilio support.
  2. まれにしか事象が発生しない場合、環境的な要因か特定のユーザーの使用スタイルに依存している可能性があります。 この事象がよく発生する特定のユーザー、電話機、あるいは場所がないかどうか確認してください。
  3. Check how your application handles <Gather>. <Gather> may receive all of the inputs from your user, but your application may not properly handle the request at the URL specified in <Gather action="">. Be sure to check that action="" points to the correct location, and that your specified location can accept requests made with the method you are using.

<Gather>の実装についての追加ヘルプについては、こちらのガイドを参照してください。

国際通話の問題

Twilioはワールドワイドでの通話をサポートしますが、国際パーミッションを明示的に有効にしておく必要があります。 国際パーミッションはこちらからオンにできます。

アカウントがまだ国際発信用にセットアップされていない場合は、Twilioサポートまでお問い合わせいただき、アクセスをリクエストしてください。 アカウントでアクセスが許可された後は、グローバルパーミッションページに再度アクセスして通話を発信したい国をオンにしてください。

Recording Resource Exceptions

The Recording API may occassionally throw an exception along the lines of:

Twilio\Exceptions\RestException: [HTTP 400] Unable to create record: Requested resource is not eligible for recording (uncaught exception) at /path/to/your/twilio/code.file

The call resource could be ineligible for recording for a number of reasons, but it typically means that you're trying to record a call that has already been completed (for example, both parties hung up) or a call that never established (for example, a failed call, or a call in which the caller hung up before media started flowing.)

You can get more detailed information about the phone call by using the REST API or through your call logs in the Twilio Console.

他のツールとAdd-On

Twilio Status

Twilio Statusページ(英語)から、Twilioのシステムのリアルタイムステータスを常時確認できます。 Twilio側に何らかの問題が発生した場合は、こちらで確認することができます。

Voice InsightsとAdd-on

If you're looking for additional insights into your voice calls, you may want to consider Voice Insights, which gives you use real-time data about call quality, carrier analytics, and WebRTC performance to proactively assist customers and minimize support time.

Twilio also offers a wide variety of add-ons that help you easily access partner technologies that let you do more with Twilio. You can see the entire catalog of add-ons in the marketplace, including Twilio Carrier Information and the #1 Robocall and Spam Blocking solution

サポートへ問い合わせる

If you're still having trouble with your Twilio Voice calls, you can reach out to our support team for 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 Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

        
        
        

        フィードバックくださりありがとうございます!

        Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

        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!

        ステップ1

        Get link

        Get a free personal referral link here

        ステップ2:

        Give $10

        Your user signs up and upgrade using link

        ステップ3

        Get $10

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