【发布时间】:2021-04-06 13:27:22
【问题描述】:
我正在尝试通过 Amazon SNS 向使用 cognito 注册帐户并验证其电话号码的用户的手机发送短信确认消息。我的 cognito 用户池位于 us-east-2,我最近将 us-east-1 和 us-east-2 的支出限额提高到 50 美元。我测试了通过 sns 控制台向我的手机发送短信,效果很好。但是,尝试在 cognito 上验证用户时,我没有收到短信。检查 sns 控制台时,似乎唯一成功发送到我手机的消息是我从控制台手动发送的消息,而其他一切都失败了。任何帮助将不胜感激。
我发现错误来自我作为 sprint 运营商的特定电话号码,并得到以下日志失败响应:
{
"notification": {
"messageId": "5dab56f3-2dd3-5a6d-b96e-0e96904d334b",
"timestamp": "2020-12-29 23:27:26.712"
},
"delivery": {
"phoneCarrier": "SPRINT Spectrum L.P.",
"mnc": 880,
"numberOfMessageParts": 1,
"destination": "+1******3252",
"priceInUSD": 0.00645,
"smsType": "Transactional",
"mcc": 311,
"providerResponse": "Blocked as spam by phone carrier",
"dwellTimeMs": 202,
"dwellTimeMsUntilDeviceAck": 1254
},
"status": "FAILURE"
}
但是,我使用 AT&T 手机和 TMobile 手机进行了测试,它们成功发送了消息,并显示以下日志响应:
{
"notification": {
"messageId": "3106a00c-40de-53ce-9f40-f869fc025013",
"timestamp": "2020-12-29 23:24:12.183"
},
"delivery": {
"phoneCarrier": "T-mobile USA Inc.",
"mnc": 800,
"numberOfMessageParts": 1,
"destination": "+1******1131",
"priceInUSD": 0.00645,
"smsType": "Transactional",
"mcc": 310,
"providerResponse": "Message has been accepted by phone",
"dwellTimeMs": 238,
"dwellTimeMsUntilDeviceAck": 601251
},
"status": "SUCCESS"
}
这个错误对我来说真的很奇怪,因为 SPRINT 应该没有理由阻止我的手机仅在 cognito 上从 aws sns 接收短信,但其他电话服务允许接收短信。我仍然可以从 SNS 控制台获取消息,但只有 cognito 无法发送,运营商阻止了它。任何帮助将不胜感激!
【问题讨论】:
标签: amazon-web-services amazon-cognito amazon-sns