[PATCH] osmo-msc[master]: libmsc: Use actual delivery time in delivery reports.

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Aug 24 17:41:13 UTC 2017


Review at  https://gerrit.osmocom.org/3672

libmsc: Use actual delivery time in delivery reports.

Set the time on the status report to the time the message was delivered, as
this may not be the same as the time when we are delivering the report to the
originating MS.

Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8
---
M include/openbsc/gsm_data.h
M src/libmsc/db.c
M src/libmsc/gsm_04_11.c
3 files changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/72/3672/1

diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h
index 51cf6dc..f4de381 100644
--- a/include/openbsc/gsm_data.h
+++ b/include/openbsc/gsm_data.h
@@ -511,6 +511,7 @@
 	} smpp;
 
 	unsigned long validity_minutes;
+	time_t created;
 	bool is_report;
 	uint8_t reply_path_req;
 	uint8_t status_rep_req;
diff --git a/src/libmsc/db.c b/src/libmsc/db.c
index 3495806..ae7e287 100644
--- a/src/libmsc/db.c
+++ b/src/libmsc/db.c
@@ -742,6 +742,7 @@
 
 	/* FIXME: validity */
 	/* FIXME: those should all be get_uchar, but sqlite3 is braindead */
+	sms->created = dbi_result_get_datetime(result, "created");
 	sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req");
 	sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req");
 	sms->is_report = dbi_result_get_ulonglong(result, "is_report");
diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c
index 55642aa..c5bcce7 100644
--- a/src/libmsc/gsm_04_11.c
+++ b/src/libmsc/gsm_04_11.c
@@ -312,11 +312,11 @@
 
 	/* generate TP-SCTS (Service centre timestamp) */
 	smsp = msgb_put(msg, 7);
-	gsm340_gen_scts(smsp, time(NULL));
+	gsm340_gen_scts(smsp, sms->created);
 
 	/* generate TP-DT (Discharge time, in TP-SCTS format). */
 	smsp = msgb_put(msg, 7);
-	gsm340_gen_scts(smsp, time(NULL));
+	gsm340_gen_scts(smsp, sms->created);
 
 	/* TP-ST (status) */
 	smsp = msgb_put(msg, 1);

-- 
To view, visit https://gerrit.osmocom.org/3672
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Keith Whyte <keith at rhizomatica.org>



More information about the gerrit-log mailing list