SMS 未进入 aws SNS 服务

SMS is not geting in aws SNS service

我尝试从 AWS SNS 控制台发布短信。它显示成功的结果。但消息没有得到。 每个请求在控制台中都被标记为失败

发短信时的回复:
短信已成功发布到 phone 号码 +91XXXXXXXXXX。 消息“ID”:e3d2bc39-2792-5b2e-adcc-e4733a800795

您可以激活传送状态记录

来自Viewing Amazon CloudWatch metrics and logs for SMS deliveries - Amazon Simple Notification Service

  • On the Text messaging (SMS) page, in the Text messaging preferences section, choose Edit.
  • On the Edit text messaging preferences page, in the Delivery status logging section, do the following:
    • Sample rate: 100%
    • Service role: Create a new service role (or choose an existing one if it is there)

然后您可以直接从短信 (SMS) 页面发送短信。它将显示 交付统计数据 图表以指示 success/failure。

此外,对于每条消息,Amazon CloudWatch Logs 中都会有一个日志条目(转到 CloudWatch / Logs / 然后选择 SNS 日志)。它看起来类似于:

{
    "notification": {
        "messageId": "xxx",
        "timestamp": "2020-12-09 08:40:19.536"
    },
    "delivery": {
        "phoneCarrier": "Optus Mobile Pty Ltd",
        "mnc": 2,
        "numberOfMessageParts": 1,
        "destination": "+61455555555",
        "priceInUSD": 0.03809,
        "smsType": "Promotional",
        "mcc": 505,
        "providerResponse": "Message has been accepted by phone carrier",
        "dwellTimeMs": 524,
        "dwellTimeMsUntilDeviceAck": 2453
    },
    "status": "SUCCESS"
}

此日志将为您提供有关短信是否已发送到 phone 运营商的最详细信息,以便您可以确定它可能在哪里失败。

我遇到了同样的问题,发现我需要生成支持票证才能使用 SNS SMS。 以下是 link 用于生成支持票证,解释您的 SNS SMS 使用案例

SNS support ticket link