aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/db.c
AgeCommit message (Collapse)AuthorFilesLines
2009-12-21[db] Fix queries for unsent SMSSylvain Munaut1-3/+5
- Need to use sms.id for the ORDER BY since 'subscriber' also has 'id' - Need to add the join clause between 'SMS' and 'subscriber' - Add a LIMIT 1 (probably no impact for the db size we're dealing with here, but with large DB and mysql/postgresql this can help the planner) - (fix a wrong comment in passing ...) Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-09fix compile warning in db.cHarald Welte1-1/+1
2009-11-07change some identifiers from u_int64_t to unsigned long longHarald Welte1-1/+1
makes printf much easier on 64bit platforms...
2009-10-22[db] Fix compile warnings in db.cHolger Hans Peter Freyther1-3/+5
For the compiler classmark1 is a struct and the compiler is unaware that it fits into an unsigned int. Use memcpy to copy it to a u_int8_t (the compiler should inline this). dbi_conn_quote_binary_copy works on unsigned char* change q_apdu to be unsigned char.
2009-09-28[tmsi] Make the tmsi a 4 octet numberHolger Hans Peter Freyther1-8/+16
tmsi is four octets long, there is no need to make it a string and then jump through hoops to convert it to a number. Keep the database using it as a string to benefit from the NULL handling of the db. Introduce the reserved tmsi which has all bits set to 1 according to GSM 03.03 ยง2.4 and start checking for it and make sure the db code will never allocate such a tmsi.
2009-09-26Use correct capitalization on SQL statementsHarald Welte1-4/+4
otherwise, SQLite seems to return the wrong data types ?!? Signed-off-by: Mike Haben <michael.haben@btinternet.com>
2009-08-17actual code running at end of har2009Harald Welte (local)1-4/+65
2009-08-16store all APDU's received from the MS in the databaseHarald Welte (local)1-0/+31
This helps us to analyze data such as RRLP location information for later analysis.
2009-08-15don't try to deliver sms to a subscriber that's not registeredHarald Welte (local)1-4/+27
2009-08-13fix token allocation sql stringsHarald Welte (local)1-13/+15
2009-08-12fix random extension generationJan Luebbe1-1/+1
2009-08-12fix problems with tmsi uniqueness in the subscriber tableJan Luebbe1-5/+19
2009-08-12fix a wrong format specifierJan Luebbe1-1/+1
2009-08-12allocate an extension when creating the subscriberJan Luebbe1-0/+29
2009-08-12token support in the DBJan Luebbe1-0/+54
2009-08-12flag new subscriber structs in memory and send a signalJan Luebbe1-0/+1
2009-08-10db.c: Move the schema revision check after creating the tablesHolger Hans Peter Freyther1-6/+6
When starting the first time there are no tables, doing a revision check will fail and bsc_hack will exit without tables created. Do the revision check within db_prepare and allow new tables to be created before.
2009-08-10db: Fix warning about truncating the sizeHolger Hans Peter Freyther1-1/+1
We are truncating the size and might should simply use a MIN here to get the returned size or the maximum we can hold..
2009-08-10misc: Add prototypes to header files, include more header filesHolger Hans Peter Freyther1-0/+1
Fix various warnings about implicit declarations of functions.
2009-08-09new db_sms_get_unsent_for_subscr() functionHarald Welte1-18/+50
The function retrieves the oldest not-yet-sent SM for the given subscriber
2009-08-09add ud_hdr_ind to SMS tableHarald Welte1-9/+45
we also implement verification of the database schema number by using the 'Meta' table.
2009-08-08first 'working' SMS implementationHarald Welte1-42/+68
we now have the full path from the MS into the database (SUBMIT), as well as back from the database to the MS (DELIVER). The database gets correctly updated once a SMS has been successfully delivered. What's still missing is the periodic scan over all undelivered messages, trying to deliver them to the respective MS. So far, you have to manually trigger this on the telnet interface with 'sms send pending 1'
2009-07-27further steps towards better, transaction based SMSHarald Welte1-5/+25
2009-07-23make sure subscr->net is always setHarald Welte1-6/+12
since a subscriber is an element of the gsm_network, we have to ensure subscr->net is always set correctly. We do this by using gsm_network as an argument to all functions that resolve or create a subscriber.
2009-07-05Merge branch 'master' into smsHarald Welte1-0/+38
2009-07-05Store classmark1/2/3 in equipment SQL tableHarald Welte1-0/+38
For further evaluation/analysis, this patch stores the classmark 1, 2 and 3 values of every equipment in the SQL database. We can use this non-volatile data to determine the supported features for each handset that we've ever seen on our network.
2009-07-05further SMS workHarald Welte1-1/+24
* implement ID based lookup of gsm_subscriber from database * look-up recipient and sender subscribers from database
2009-07-05more SMS improvementsHarald Welte1-2/+6
* describe data structures in gsm_04_11.h * increae LCHAN RELEASE TIMEOUT for case of long SMS * convert header field in sql table from NUMERIC to BLOB * initial handling for validity period * send RP ERROR messages with meaningful RP CAUSE in case of error
2009-06-10move openbsc into its own subdirectoryHarald Welte1-0/+464