5
votes

I am trying to send sms notifications to my indian number from AWS SNS service. While searching about this on the internet many people have mentioned in their post that SMS service is available only for US based mobile phones.

But while reading the SNS documentation i found India in the supported region.

I created a topic in SNS and created SMS subscription for my mobile number but i didnt get the subscription link.

I don't know whether my understanding is correct. Any thoughts about this ?

i tried sending it through AWS Cli commands and boto3 as well.. I got success code but i didnt get any sms.. >>> sns.publish(PhoneNumber = number, Message='example text message' ) {'ResponseMetadata': {'HTTPStatusCode': 200, 'RequestId': '96d0fd74-0657-5dd6-ba6d-adb783076e26', 'HTTPHeaders': {'x-amzn-requestid': '96d0fd74-0657-5dd6-ba6d-adb783076e26', 'date': 'Thu, 08 Dec 2016 15:58:08 GMT', 'content-length': '294', 'content-type': 'text/xml'}}, u'MessageId': '2b7ed463-2698-53ff-8b85-84a0a3c8c00f'}

Thanks in Advance

5
TRAI-india has restriction to send sms on DND numbers. You can use any india based sms gateway like SPRING EDGE for confirmation delivery.B.S.B.

5 Answers

1
votes

I had tried it and it is working for me. In India, all the telecommunication process should be approved by TRAI, Telecom Regulatory Authority Of India. As per TRAI, we can send promotional SMS between 09:00 AM to 09:00 PM only. For more information please visit https://www.trai.gov.in/.

0
votes

You can send SMS to India mobile numbers.

Simply add the number as 91xxxxxxxxxx and after couple of seconds start sending messages using the 'Publish to topic' from AWS console or via the API.

There is no confirmation process involved in this

0
votes

The SMS Notification option with SNS works worldwide, including India.

Go to SNS Service on AWS Service dashboard, you get the following options on left hand side.

  • SNS dashboard
  • Topics
  • Applications Subscriptions
  • Text messaging (SMS)

Click Text Messaging (SMS), and you will get the following options:

  • Manage text messaging preferences
  • View opted-out phone numbers
  • Send a text message (SMS)

To run a test, just use the option Send a text message (SMS) If you do not have any constraints on your user/account you should be able to send a SMS. This is would be a good manual test to do before building an integration pipeline.

The places to look for more information would be:

0
votes

Try this for sending SMS in India - Notice MessageAttributes.

var AWS = require("aws-sdk");

module.exports.sendSMS = function sendSMS(req, res) {
  var params = {
    Message: "Your OTP verification code is 3493",
    PhoneNumber: "+" + req.body.phone_number,
    MessageAttributes: {
      "AWS.SNS.SMS.SMSType": {
        DataType: "String",
        StringValue: "Transactional",
      },
      "AWS.SNS.SMS.SenderID": {
        DataType: "String",
        StringValue: "Horoscope",
      },
    },
  };

  var sns = new AWS.SNS({
    apiVersion: "2010-03-31",
    region: "ap-south-1",
  });
  sns.setSMSAttributes({
    attributes: {
      DefaultSenderID: "Horoscope",
      DefaultSMSType: "Transactional",
    },
  });
  return sns.publish(params).promise();
};
0
votes

Make sure to select the message type as Transactional. Promotional might not be allowed by the telecom provider by default.