GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - smsgatewaycenter/dlt-sms-preflight: Check an SMS against its registered DLT template before sending (India)

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
dltPreflight.js
dltPreflight.js
 
 
package.json
package.json
 
 
test.js
test.js
 
 

Repository files navigation

dlt-sms-preflight

Check an SMS against its registered DLT template before you send it to an Indian number.

Indian operators drop any SMS that doesn't match its registered DLT template. Since TRAI's direction of 18 Nov 2025, each variable must also be tagged with the type of value it holds. This module catches most mismatches in your own code, so you can run it in CI.

No dependencies. Node 18+.

What it checks

  • Each value fits its tag: {#numeric#}, {#alphanumeric#}, {#url#}, {#urlott#}, {#cbn#}, {#email#}
  • Untyped legacy {#var#} slots, which need re-registering
  • URL hosts against your whitelist
  • The fixed text of an already-built message, character for character
  • GSM-7 vs UCS-2 encoding and segment count (one curly apostrophe can double your cost)

Usage

const { render, matches, segments } = require('./dltPreflight');

const tpl = 'Rs {#numeric#} debited from your ACME wallet. Ref {#alphanumeric#}. - ACME';

render(tpl, ['5000', 'TXN88231']);      // returns the message
render(tpl, ['5,000.00', 'TXN88231']);  // throws: Slot 1 {#numeric#} needs digits only

matches(tpl, someMessageFromYourCRM);   // true or false
segments('Don’t share');                // { encoding: 'UCS-2', units: 11, segments: 1 }

Run the tests

node test.js

Limits

This is a pre-flight check, not the operator's scrubbing algorithm. The value patterns in TAG_RULES and MAX_VAR_LENGTH are approximations, so set them to what your DLT portal enforces. It can't see your DLT registration, so it won't catch a wrong header, a wrong category or an unapproved template.

More on the tagging change: SMS Gateway Center's notes on mandatory variable tagging.

License

MIT

About

Check an SMS against its registered DLT template before sending (India)

www.smsgatewaycenter.com/blog/trai-dlt-mandatory-variable-tagging-sms-templates/

Topics

dltindianodejsotpsmssms-apitrai

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.