aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc/smpp_openbsc.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2022-05-17 19:01:43 +0200
committerHarald Welte <laforge@osmocom.org>2022-05-17 19:30:46 +0200
commit8ceab5f076119946f5918280b1a15a4223445609 (patch)
tree5ce6440aed0b0f7981c5bf878ea6f31f17201f63 /src/libmsc/smpp_openbsc.c
parenta03416b80661c4fc9d4303c6a1554252dc6e3a8c (diff)
sms: Introduce VTY-configurable minimum SMS validity periodlaforge/sqlite3
This is meant as a safeguard against users or user equipment which doesn't set a reasonable validity period. Using this setting, the SMSC administrator can set a minimum SMS validity period. Any SMS submitted with lower validity period will be extended to that minimum. Change-Id: I192528a6f9059d158fa12876a247d61bd7edaec8 Related: OS#5567
Diffstat (limited to 'src/libmsc/smpp_openbsc.c')
-rw-r--r--src/libmsc/smpp_openbsc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c
index 64d4f1e2e..91666a9ca 100644
--- a/src/libmsc/smpp_openbsc.c
+++ b/src/libmsc/smpp_openbsc.c
@@ -267,6 +267,13 @@ static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net,
else
sms->validity_minutes = (t_validity_absolute - t_now) / 60;
+ if (sms->validity_minutes < net->sms_queue_cfg->minimum_validity_mins) {
+ LOGP(DLSMS, LOGL_INFO, "SMS to %s: Overriding ESME-provided validity period (%lu) "
+ "with minimum SMSC validity period (%u) minutes\n", submit->destination_addr,
+ sms->validity_minutes, net->sms_queue_cfg->minimum_validity_mins);
+ sms->validity_minutes = net->sms_queue_cfg->minimum_validity_mins;
+ }
+
*psms = sms;
return ESME_ROK;
}