SNS cuts off 2 digits from phone number

0

I'm trying to send text messages via lambda using boto3 sns client. Some messages to through fine but I can see from sns-console that some destination phone numbers are cut short. For example I'm trying to send message to phonenumber "+358501234567". In sns consoles delivery status logs I see that my "destination phone number" is 3585012345. Why does this happen? These messages fail and logs give me the following error: "Unknown error attempting to reach phone"

import json
import boto3

def lambda_handler(event, context):
    sns = boto3.client('sns')
    msgdata = sns.publish(PhoneNumber = "+358XXXXXXX", Message = "Test", Subject = "Alert")
    print(msgdata)
    # TODO implement
    return {
        'statusCode': 200,
        'body': json.dumps('Hello from Lambda!')
    }
1 réponse
0

Dear AWS-User-60837578,

While we where not directly able to reproduce your issue, here are our best attempt suggestions to help you resolve your issue:

  1. Ensure that the number you are trying to reach is valid: SNS follows the E.164, which is an international standards for phone addressing. Standard subscriber numbers are limited to 12 digits.
  2. Ensure your code allows for the maximum possible range of numbers. The given number in your question is longer than the example listed in the code. If you are using some kind of string replacement, it is possible your characters are being left behind there.

Our guide to pushing to mobile phone numbers is here bellow. This includes code samples that utilize our best practices. https://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html

Hopefully this helps you solve the issue. We are always happy to respond if you have further questions!

Issac_A
répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions