aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-03-25 09:59:30 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-03-25 09:59:30 +0100
commitb464fb4a8958848273da05505b64f3074430b80f (patch)
treee12db9b2651bcdf4e4680d5b9a5ceb1de3b27f1a /openbsc
parent3f96458d73f9e7bece46a2753a1d99cd280a37a5 (diff)
db: Fix a bug where no pending SMS were found
The "sms send pending" VTY command did not work due a mismatch of types. We are specifying a unsigned long long in the query and provided DBI with a signed integer type. The result was a failure do find any information. Change the API to operate on unsigned long long that is matching the id of the SMS and the Subscriber and the mismatch with the query string is gone and pending SMS are sent.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/db.h4
-rw-r--r--openbsc/src/db.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/openbsc/include/openbsc/db.h b/openbsc/include/openbsc/db.h
index df664dbc1..d0a1278ef 100644
--- a/openbsc/include/openbsc/db.h
+++ b/openbsc/include/openbsc/db.h
@@ -55,8 +55,8 @@ int set_authtuple_for_subscr(struct gsm_auth_tuple *atuple,
/* SMS store-and-forward */
int db_sms_store(struct gsm_sms *sms);
-struct gsm_sms *db_sms_get_unsent(struct gsm_network *net, int min_id);
-struct gsm_sms *db_sms_get_unsent_by_subscr(struct gsm_network *net, int min_subscr_id);
+struct gsm_sms *db_sms_get_unsent(struct gsm_network *net, unsigned long long min_id);
+struct gsm_sms *db_sms_get_unsent_by_subscr(struct gsm_network *net, unsigned long long min_subscr_id);
struct gsm_sms *db_sms_get_unsent_for_subscr(struct gsm_subscriber *subscr);
int db_sms_mark_sent(struct gsm_sms *sms);
diff --git a/openbsc/src/db.c b/openbsc/src/db.c
index 10c1d6d4c..9409ba5d6 100644
--- a/openbsc/src/db.c
+++ b/openbsc/src/db.c
@@ -1014,7 +1014,7 @@ static struct gsm_sms *sms_from_result(struct gsm_network *net, dbi_result resul
}
/* retrieve the next unsent SMS with ID >= min_id */
-struct gsm_sms *db_sms_get_unsent(struct gsm_network *net, int min_id)
+struct gsm_sms *db_sms_get_unsent(struct gsm_network *net, unsigned long long min_id)
{
dbi_result result;
struct gsm_sms *sms;
@@ -1041,7 +1041,7 @@ struct gsm_sms *db_sms_get_unsent(struct gsm_network *net, int min_id)
return sms;
}
-struct gsm_sms *db_sms_get_unsent_by_subscr(struct gsm_network *net, int min_subscr_id)
+struct gsm_sms *db_sms_get_unsent_by_subscr(struct gsm_network *net, unsigned long long min_subscr_id)
{
dbi_result result;
struct gsm_sms *sms;