This is a continuation of the patch series for the SMS validity fixes in libosmocore.
Note, that this patch is based on top of the SMS DB change to remove receiver ID. It is also available in the achemeris/sms-validity-fix-master branch in the git repo.
On Sat, Mar 08, 2014 at 04:53:12PM +0100, Alexander Chemeris wrote:
"(datetime('now'), %u, "
"(%s, %s, "
...
validity_timestamp,
received_timestamp, validity_timestamp,
Please do not change the created to be the received timestamp. If you want to have a received_timestamp then introduce it. In case you hurry up we can get it into schema version 4.
On Sat, Mar 8, 2014 at 5:49 PM, Holger Hans Peter Freyther holger@freyther.de wrote:
On Sat, Mar 08, 2014 at 04:53:12PM +0100, Alexander Chemeris wrote:
"(datetime('now'), %u, "
"(%s, %s, "...
validity_timestamp,
received_timestamp, validity_timestamp,Please do not change the created to be the received timestamp. If you want to have a received_timestamp then introduce it. In case you hurry up we can get it into schema version 4.
I don't see any immediate needs for having created timestamps, but I agree that it's a good idea to keep it. The updated patch is attached and the branch is updated.
Alexander Chemeris wrote:
+++ b/openbsc/src/libmsc/gsm_04_11.c @@ -102,6 +102,10 @@ struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver, sms->protocol_id = 0; /* implicit */ sms->data_coding_scheme = dcs; strncpy(sms->dst.addr, receiver->extension, sizeof(sms->dst.addr)-1);
- /* Timestamps */
- time(&sms->received_time);
- time(&sms->valid_until);
- sms->valid_until += SMS_DEFAULT_VALIDITY_PERIOD;
In order to make this a bit more atomic I'd suggest replacing the second time() with reuse of the first value.
sms->valid_until = sms->received_time + SMS_DEFAULT_VALIDITY_PERIOD;
The INSERT statement change is pretty gross but oh well.
//Peter
On Sat, Mar 8, 2014 at 7:58 PM, Peter Stuge peter@stuge.se wrote:
Alexander Chemeris wrote:
+++ b/openbsc/src/libmsc/gsm_04_11.c @@ -102,6 +102,10 @@ struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver, sms->protocol_id = 0; /* implicit */ sms->data_coding_scheme = dcs; strncpy(sms->dst.addr, receiver->extension, sizeof(sms->dst.addr)-1);
/* Timestamps */time(&sms->received_time);time(&sms->valid_until);sms->valid_until += SMS_DEFAULT_VALIDITY_PERIOD;In order to make this a bit more atomic I'd suggest replacing the second time() with reuse of the first value.
sms->valid_until = sms->received_time + SMS_DEFAULT_VALIDITY_PERIOD;
Good idea. Not sure why I didn't have this before. I've updated the branch.
On Sat, Mar 8, 2014 at 5:49 PM, Holger Hans Peter Freyther holger@freyther.de wrote:
In case you hurry up we can get it into schema version 4.
I've submitted one more patch, affecting the DB scheme. I hope we could include it into the same batch of DB changes. [PATCH 2/2] sms,db: Do not store delivered messages in the DB.
On Sat, Mar 08, 2014 at 10:16:25PM +0100, Alexander Chemeris wrote:
On Sat, Mar 8, 2014 at 5:49 PM, Holger Hans Peter Freyther holger@freyther.de wrote:
In case you hurry up we can get it into schema version 4.
I've submitted one more patch, affecting the DB scheme. I hope we could include it into the same batch of DB changes. [PATCH 2/2] sms,db: Do not store delivered messages in the DB.
Sure. We should do all the schema changes now.
I've updated the patch due to gsm340_validity_time() function rename.
On Tue, Mar 11, 2014 at 5:33 PM, Holger Hans Peter Freyther holger@freyther.de wrote:
On Sat, Mar 08, 2014 at 10:16:25PM +0100, Alexander Chemeris wrote:
On Sat, Mar 8, 2014 at 5:49 PM, Holger Hans Peter Freyther holger@freyther.de wrote:
In case you hurry up we can get it into schema version 4.
I've submitted one more patch, affecting the DB scheme. I hope we could include it into the same batch of DB changes. [PATCH 2/2] sms,db: Do not store delivered messages in the DB.
Sure. We should do all the schema changes now.