メニュー

Expand
ページを評価:

SMSの一般的な問題をデバッグする

SMSメッセージの送受信時にユーザーが直面する一般的な問題がいくつかあります。 このガイドでは一般的な問題をいくつか取り上げ、トラブルシューティングのコツをご紹介します。

My message wasn’t delivered

不達 (undelivered) メッセージにはいくつかのトラブルシュート方法があります。

  1. Check your SMS logs for a record of the SMS request. If you don’t see a record of your message at all, the message likely encountered an error in your application or potentially with Twilio’s API:
  2. メッセージがログ上で確認できず、かつアプリケーションコードがエラーを生成している場合:
    • You can find some sample requests for sending SMS messages in your language of choice here on our documentation. These sample requests can help isolate any syntax issues that may have cropped up in your code.
  3. If you can’t find the SMS in your logs and you received an error from Twilio:
    • If you received a 4XX response from Twilio’s API, Twilio encountered a problem and wasn’t able to send the message. You can look up the code you received in this list of errors.
  4. If the message is marked Undelivered or Failed in Twilio’s logs:
    • In this case, Twilio received a delivery receipt from one of our carriers indicating that the message was not delivered. This can happen for several reasons, including carrier content filtering or the availability of the destination phone.
  5. The message is marked Sent or Delivered in the logs but wasn’t sent to the device:
    • To further debug, check out the section below for troubleshooting tips when a message doesn’t arrive at your device.

I’m not receiving SMS messages on my Twilio phone number

Twilio番号にメッセージがTwilio番号で受信されない場合、確認すべき点がいくつかあります。

  1. Is your Twilio number SMS-enabled? Does it have a webhook configured?
    • Log in to your Twilio account, navigate to the Phone Numbers section and click on Manage Numbers.
    • Any number that shows the SMS icon can send and receive SMS messages:
      SMSまたはMMSに対応した電話番号を購入します
    • If there is no icon under SMS, your Twilio number does not have SMS capabilities. Click on Buy a Number to purchase an SMS-enabled Twilio number.
    • Your number also needs to have a URL associated with it to receive incoming SMS. You can set up this webhook the Console for any Twilio phone number you own:
      Configure a Webhook for your Twilio Number
  2. 国際電話番号からのSMSの受信が想定されていますか?
    • Some international carriers aren’t able to successfully pass off SMS messages to Twilio’s network. Because of this, Twilio can’t guarantee that international messages will always be received.
    • If you’re receiving domestic but not international SMS messages, we recommend contacting the international sending carrier.
  3. ローミングを行なっているか、圏外になっていませんか?
    • Twilio can’t guarantee the deliverability of SMSes from roaming phone numbers. Twilio does not have the ability to determine whether or not the phone number you are sending messages from is roaming at the time.
  4. ショートコードからのSMS受信を想定していますか?
    • Twilio accounts can now be enabled to receive messages from short codes. This is an account-wide setting, which will apply to all long code numbers that belong to your Twilio account.
    • Your account must have a Twilio number from the same country as the short code from which you expect to receive messages. Short code numbers are always country-specific and can only communicate with numbers from the same country.
    • Please contact Twilio Support to have this option enabled on your account. It’s important to note that even when this feature is enabled, we can’t always guarantee delivery of these incoming messages due to factors outside of our control.

From/To pairs violating blocked sender rules

When sending messages, you may see a response from Twilio about the message’s From/To pair violating delivery rules. The Twilio API returns this message if you attempt to send an SMS or MMS to a recipient who has previously replied STOP, STOPALL, UNSUBSCRIBE, CANCEL, END, or QUIT to your Twilio number. You will not be charged for this send attempt.

When a user opts out of receiving communications from a phone number that belongs to a Messaging Service, they are also opted out of all messages sent from that particular Messaging Service.

If you are to send messages to a recipient who has opted out this way, they must first text START or YES to your Twilio number to opt in again.

Why do I encounter duplicate messages?

The best way to begin debugging duplicate message issues is to review your message logs. You should look for a record of the message in question, as well as other messages that are duplicates that were sent within seconds of each other.

If you find duplicate messages sent within a few seconds of each other in your logs, it means that Twilio sent multiple messages to the carrier. This almost always means that Twilio received multiple POST requests from your application. Please check the HTTP request logs on your server to examine the requests you sent to Twilio.

It is extremely rare for Twilio’s system to create a duplicate message without receiving a POST from your application. If you’ve checked your server logs and only see one request to Twilio, please let us know by contacting support with the SIDs of the duplicated messages.

If you find only one message in your logs, it means that Twilio sent just one message to the carrier and the duplication happened within the carrier’s system. Users of all types of phones do occasionally receive duplicate messages, typically as the result of a safeguard that carriers implement when they suspect there may have been a service disruption. Duplicate messages may also occur when the recipient is roaming.

If duplicate messages occur for an extended time and with several different recipient carriers, please let us know by collecting the message records of the duplicated messages and contacting support.

My messages are delayed

To troubleshoot issues with delayed messages or other delivery issues, start by testing your numbers with the API Explorer. First, create a message, filling out the From, To, and Body fields and any other relevant fields. Click Make Request and keep the page open so you can examine the response when it arrives.

API Explorerでメッセージを送信する際は、下記の3つのうちのいずれかの結果になります:

  1. The message arrives within 30 seconds.
    • メッセージの問題はほとんどの場合、開発中のアプリケーションコードに原因があります。 下記を確認してください:
      • The To and From values you used in your code match those you used in the API Explorer.
      • API Explorerで生成されたコードスニペットを開発中のアプリケーション内で試し、問題が改善するかどうか確認します。
      • Check your HTTP logs and verify the requests you made to Twilio did not result in 40x or 50x errors.
      • Be sure that you are using the correct Account SID and Auth Token. Please note that using the Test Credentials will produce a response indicating that the message has been sent, but the message will not actually be sent.
  2. The message arrives more than 30 seconds later.
    • SMS messages sent from Twilio typically arrive at their destination in 5-10 seconds, depending on the country and the carrier. If a message takes more than 30 seconds for delivery, we consider it ‘delayed’.
      • Look in your SMS logs under Delivery Steps to see more detailed timestamps, including when the request was created, how long it stayed queued on Twilio’s platform, and when we sent it to our carrier partner for delivery. This information can help you track down where latency may originate.
      • A large number of queued messages on the From number may increase latency. For more information on latency, see this article which describes Twilio’s rate limits.
      • 下りのキャリアーネットワークは混雑することがあります。 こうした問題は下りのトラフィック混雑が解消されると、自動的に改善します。
  3. No message arrives.
    • API Explorerが201レスポンスを生成した場合は、下記を確認してください:
      1. Verify that the To phone number:
        • 番号は有効であり、かつアクティブですか。
        • 電波状況は良好ですか。そうではない場合メッセージは遅延する可能性があります。
        • 他の送信元および送信者からのメッセージを受信できますか。
        • 国際ローミングしていませんか。
        • 「受信拒否」リストに登録されていませんか。
        • Is not blocked by the carrier. If you are sending the message from a Twilio long code, try sending from a different Twilio long code. If the message is properly received, you’ve likely encountered a carrier’s volume threshold on your original long code. See this FAQ for more information.
      2. メッセージの再送信をお試しください。 これはしばしば、問題を切り分ける最良の方法になります。 メッセージが依然として送信されない場合は、各不達メッセージに対応するSMSのメッセージSIDを添えて株式会社KDDIウェブコミュニケーションズのサポート窓口にご連絡ください。 これらのSIDはAPI Explorerのレスポンスに一覧されます。
    • API Explorerが404レスポンスを生成した場合は、Twilioはメッセージを送信できませんでした。
      • 404レスポンスを返したメッセージにはエラーコードと、そのエラーコードに対する詳細な説明へのリンクが含まれています。 全エラーコードの情報については、こちらで確認できます。

For building messaging applications at scale, we have a document detailing best practices to get you started in a way that minimizes latency and shows you how to monitor your messages with Messaging Insights.

ページを評価:

ヘルプが必要ですか?

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.

        
        
        

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

        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!

        ステップ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