- Newest
- Most votes
- Most comments
When you don't explicitly specify an origination number in your SMS message request, Amazon SNS selects an origination number automatically based on a fallback mechanism.
The selection process follows this order of priority:
- Origination numbers (with correct resource policies that allow SNS/Pinpoint service)
- Short codes first
- 10DLC numbers second
- Long codes or toll-free numbers last
- Sender IDs (with correct resource policies)
- Shared routes
In your specific case with a TFN for the US and a long code for Canada, SNS will automatically select the appropriate origination identity based on the destination country. For US recipients, it will use your TFN, and for Canadian recipients, it will use your long code.
You don't need to create a custom SMS sender Lambda to handle this routing - SNS handles it automatically based on the destination country requirements. The issue you experienced with Canadian users not receiving SMS when you only had a US TFN was likely because some countries require country-specific origination identities due to local regulations.
When sending SMS through Cognito, it leverages SNS's automatic selection mechanism. As long as you have the appropriate origination identities set up in your AWS account for each destination country (which you now do with both a US TFN and a Canadian long code), SNS will automatically use the correct one based on the recipient's country.
Sources
A Guide to the New Resource Policies for SMS Origination Identities in AWS | AWS Messaging & Targeting Blog
Sending SMS messages using Amazon SNS - Amazon Simple Notification Service
Amazon Simple Notification Service (SNS) SMS Pricing | Messaging Service | AWS
Hello Drashti. Here's a positive update for you:
US TFN's are now able to send internationally, and for Canada specifically: support two-messaging, and a throughput of 3MPS. (This is a higher throughput than Canadian long codes which only support 1MPS)
You can enable/disable this feature for existing or when registering for new TFNs. In either in the console or via the API/CLI.
For the Console: In the End User Messaging Console under Phone numbers > select the existing TFN > Under the international sending tab, select Edit settings > Enable International Sending
For CLI:
aws pinpoint-sms-voice-v2 update-phone-number
--phone-number-id "phonenumber-a1b2c3d4e5f67890"
--international-sending-enabled
--region us-east-1
Note: Replace "phonenumber-a1b2c3d4e5f67890" with your actual phone number’s ID
Hope this helps.
Relevant content
- AWS OFFICIALUpdated 3 years ago
