SMS in India (DLT)
Send SMS that Indian operators accept: register on DLT, then enter the entity ID and template IDs for AWS SNS, SMPP or Twilio.
In India every commercial SMS must be registered on a TRAI DLT (Distributed Ledger Technology) portal of an operator. A message carries the sender's Principal Entity ID (PE ID) and the ID of a content template whose text it matches; operators block messages without them. Aniston Nexus sends both IDs with the SMS providers AWS SNS and SMPP, and works with Twilio's own DLT registration. Outside India leave the DLT fields empty: nothing changes.
Before you start
On the DLT portal of your operator (or through your SMS aggregator):
- Register the organization and note the entity ID (usually 19 digits).
- Register a header (sender ID), for example
UOHWTR. - Register a content template for every message text you send, as a Service Implicit or Service Explicit template, with variables as
{#var#}. Note each template ID.
The text that Aniston Nexus sends must match a registered template exactly, apart from the variables. Write the alarm notification templates, the test message and the two-factor authentication message with that in mind.
Configure the SMS provider
The system administrator opens Settings > Notifications, section SMS provider, and opens India DLT (TRAI).
| Field | Meaning |
|---|---|
| DLT Principal Entity ID | Sent with every SMS |
| Default DLT template ID | Used when a message has no template ID of its own (SMS from rule chains, test SMS without an ID) |
| 2FA code DLT template ID | Template of the two-factor authentication code message. Empty: the default template ID |
All IDs are digits only, at most 30. The form and the server both check them.
AWS SNS
- Sender ID: 1-11 letters and digits; in India your DLT header.
- The entity and template IDs are sent as the SNS message attributes
AWS.MM.SMS.EntityIdandAWS.MM.SMS.TemplateId; messages are sent as Transactional. - Register the same entity, header and templates in the Amazon SNS console for India (origination identities). Aniston Nexus uses the AWS SDK for Java v2.
SMPP
- The IDs are sent as optional SMPP parameters (TLVs). This needs SMPP 3.4: with 3.3 they are not sent.
- Entity ID TLV tag and Template ID TLV tag: by default
0x1400and0x1401, which most Indian aggregators use. Your aggregator tells you if theirs differ (allowed0x1400to0x3FFF, decimal or hex; the two tags must differ). - Send TLV values with a terminating zero byte: turn on only if the aggregator expects C-octet strings.
Twilio
Twilio links the entity ID and the templates to the sender in the Twilio console, so there are no DLT fields here. Phone Number From can be a phone number, a phone number SID or a Messaging Service SID (MG followed by 32 hex digits); a Messaging Service is the usual choice for India.
Template ID per message
| Message | Where the template ID comes from |
|---|---|
| Notifications (alarm rules, notification center) | Notifications > Templates, SMS delivery method, field DLT template ID; empty: the provider default |
| Two-factor authentication code | The provider's 2FA code DLT template ID; empty: the default |
| Test SMS (Send test SMS on the provider settings) | The dialog's DLT template ID; empty: the default |
| SMS from rule chains | The provider default |
Hindi, Telugu and other scripts (SMPP)
With SMPP the text is now encoded as the configured coding scheme really requires:
- Coding 0 (SMSC default): the GSM 7-bit alphabet. Text with characters outside it (for example a Telugu or Hindi template) is sent as UCS2 (coding 8) instead of losing characters.
- Coding 8: UCS2 for every message.
- A message longer than 254 bytes goes into the
message_payloadparameter (SMPP 3.4). SMPP 3.3 refuses it with an error.
An SMSC that rejects a message (non-zero command status) is now reported as a failed SMS, in the notification log and in the test dialog, instead of being counted as sent.
Troubleshooting
| Symptom | Check |
|---|---|
| Test SMS arrives outside India but not in India | Entity ID, header and template registered with your operator; the test text matches the template |
| "SMSC rejected the message (SMPP command status 0x…)" | Ask the aggregator what the status means; often a wrong template ID or TLV tag |
| AWS SNS sends but nothing arrives | The SNS console's delivery logs; the sender ID and templates are registered for India in SNS |
| Two-factor codes are blocked | A separate template for the code message and its ID in 2FA code DLT template ID |
Command line setup of the provider (and a list of the message texts to register): solutions/nexus-water/tools/setup_sms.py. A local SMPP 3.4 test server is in solutions/nexus-water/tools/smpp_sim/.