How to configure the SMPP Validity Period field
What is the Validity Period Field?
The Validity Period in SMPP (Short Message Peer-to-Peer Protocol) is a null-terminated string field in PDUs like submit_sm
that defines
how long an SMSC will attempt to deliver a message before discarding it. This field is critical for:
- Preventing indefinite retries for undeliverable messages
- Managing SMSC storage resources
- Handling time-sensitive content (e.g., OTPs, promotions)
Field Format and Structure
The validity period uses the same absolute time format as the scheduled delivery time (SMPP v3.4 specification):
YYMMDDhhmmssnnp
Where components match the scheduled delivery time format. Common relative format shortcuts are also supported:
Format | Example | Description |
---|---|---|
Absolute | 231215235959000+ |
Dec 15, 2023 23:59:59 UTC+0 |
Relative | 000003000000000R |
3 days from submission time |
-
NULL
: Use SMSC default validity (typically 24-72 hours)-
00
: SMSC default validity (legacy systems)
Key Validity Period Formats
1. Absolute Time Format
YYMMDDhhmmssnnp // Full format 231215143000000+ // Dec 15, 2023 14:30:00 UTC+0
2. Relative Time Format
00000X000000000R // X = Days (00-99) 000003000000000R // 3 days validity
Use Cases
1. OTP Expiration (Short Validity)
validity_period: "000000010000000R" // 1 hour validity
2. Promotional Campaign (Extended Validity)
validity_period: "000007000000000R" // 7 days validity
3. Midnight Expiry (Absolute Time)
validity_period: "231215235959000+" // Expires Dec 15, 2023 23:59:59 UTC+0
Example SMPP PDUs
Example 1: 24-Hour Validity (Relative Format)
0000001D // Command Length (29 bytes) 00000004 // Command ID (SubmitSM) 00000001 // Sequence Number ... 00 // Priority Flag 00 // Schedule Delivery Time 303030303234303030303030305200 // "00002400000000R" (24 hours) 00 // Registered Delivery ...
Example 2: Absolute Expiry Time
0000002A // Command Length (42 bytes) 00000004 // Command ID (SubmitSM) 00000002 // Sequence Number ... 00 // Schedule Delivery Time 3233313231323332353935393030302B00 // "231212235959000+" (Dec 12, 2023 23:59:59 UTC+0) ...
Interactions with Other Fields
- scheduled_delivery_time: Validity period countdown starts from scheduled time if set
- priority_flag: High-priority messages may override validity period settings on some SMSCs
- registered_delivery: Delivery receipts are sent even after validity period expiration
Common Pitfalls
- Using relative format without the 'R' suffix
- Setting validity periods longer than SMSC limits (e.g., 30 days max)
- Mismatching time zones between scheduled time and validity period
- Assuming all SMSCs support relative format (verify with provider)
Many SMSCs convert relative periods to absolute timestamps upon message receipt. The countdown continues even if the SMSC restarts.
Validity Period vs SMSC Defaults
Validity Period Value | SMSC Behavior |
---|---|
NULL or 00 | Uses SMSC default (varies by provider) |
Explicit value | Honors value (within SMSC limits) |
Past timestamp | Message discarded immediately |
Conclusion
The Validity Period field is essential for controlling message lifecycle in SMPP. While absolute timestamps provide precision, relative formats offer simplicity for common use cases. Always coordinate validity settings with SMSC policies and test edge cases (e.g., daylight saving transitions). For detailed implementations, refer to SMPP v3.4 Section 5.2.18 and GSM 03.40 documentation.
More information
- How to configure the SMPP Service Type field
- How to configure the SMPP Phone Number fields
- How to configure the SMPP ESM Class field
- How to configure the SMPP PID field
- How to configure the SMPP Prioirity field
- How to configure the SMPP Scheduled Time field
- How to configure the SMPP Validity Period field
- How to configure the SMPP Registered Delivery field
- How to configure the SMPP Replace if Present field
- How to configure the sm_default_msg_id field
- How to configure the SMPP DCS field
- How to calculate the SMPP SM Length field
- How to put data into the SMPP SM field