【问题标题】:Amazon Monitor Global SMS Delivery Status亚马逊监控全球短信发送状态
【发布时间】:2016-08-16 19:04:47
【问题描述】:

我正在使用 Amazon SNS 使用 .Net 应用程序传递全球 SMS 消息 我尝试使用管理员凭据直接向手机发送短信 使用此代码:

Dictionary<string, MessageAttributeValue> smsAttributes = new Dictionary<string, MessageAttributeValue>();
smsAttributes.Add("AWS.SNS.SMS.SenderID", new MessageAttributeValue() { StringValue = "mySender", DataType = "String" });//The sender ID shown on the device.
smsAttributes.Add("AWS.SNS.SMS.MaxPrice", new MessageAttributeValue() { StringValue = "0.50", DataType = "Number" });//Sets the max price to 0.50 USD.
 smsAttributes.Add("AWS.SNS.SMS.SMSType", new MessageAttributeValue() { StringValue = "Transactional", DataType = "String" });//Sets the type to promotional.
PublishRequest request = new PublishRequest(){Message = message, PhoneNumber = phoneNumber,MessageAttributes = smsAttributes};
PublishResponse response = snsClient.Publish(request);

我的问题是: 我如何监控消息传递状态? 响应有消息 ID,没有成功或失败等传递状态

【问题讨论】:

    标签: .net amazon-sns


    【解决方案1】:

    艾哈迈德,

    SNS Worldwide SMS Messaging Blog 有专门为 SMS 启用传递状态的说明。启用后,SNS 会将所有短信成功/失败记录到CloudWatch Logs。 SMS 的 CW 日志组具有以下格式:

    成功:sns/us-east-1/xxxxxxxxxxxx/DirectPublishToPhoneNumber

    失败:sns/us-east-1/xxxxxxxxxxxx/DirectPublishToPhoneNumber/Failure

    SNS text messaging preferences (us-east-1)

    此外,您在 .NET 代码中指定的 SMS MessageAttributes 是可选的。您还可以通过每个地区的 SMS 文本消息首选项设置默认价格、类型和发件人 ID。

    希望这会有所帮助,

    -丹尼斯

    【讨论】:

      【解决方案2】:

      我也不明白他们为什么要返回消息 ID,或者有什么方法可以从该 ID 获取消息状态。

      到目前为止我的发现是,您只能在cloudwatch中记录交付状态。

      在 cloudwatch 中,它为成功失败消息状态分组。

      你可以看看这个:https://mobile.awsblog.com/blog/author/Arjun+Cholkar

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-06-04
        • 2017-06-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-09-05
        • 1970-01-01
        相关资源
        最近更新 更多