aboutsummaryrefslogtreecommitdiffstats
path: root/sql
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2019-01-09 12:03:51 +0100
committerHarald Welte <laforge@gnumonks.org>2019-01-24 15:29:08 +0000
commit81db389fd489f1b7962e72105a5a2cc5f3feb3fb (patch)
treee32a60a21953e23f8ac246435ec485fe7c722baf /sql
parent7943e269380fc00d6c8bbedca7d52360c36384f1 (diff)
Add IMEI column to subscriber table
Extend the database scheme, add imei to the hlr_subscriber struct and create db_subscr_update_imei_by_imsi() and db_subscr_get_by_imei(). The new functions are used in db_test, and in follow-up commits [1], [2]. Upgrade DB schema to version 2. SQLite can only insert new columns at the end of the table, so this happens when upgrading the database. In new databases, the column is placed after the IMEISV column (where it makes more sense in my opinion). This should not have any effect, as we never rely on the order of the columns in the tables. Follow-up commit [1] will make use of this column to save the IMEI as received from the MSC/VLR with the Check-IMEI Procedure. It was decided to use Check-IMEI instead of the recent Automatic Device Detection Procedure (which would send the IMEISV) in OS#3733, because with Check-IMEI we don't need to rely on very recent releases of the specification. [1] change-id I09274ecbed64224f7ae305e09ede773931da2a57 "Optionally store IMEI in subscriber table" [2] change-id I1af7b573ca2a1cb22497052665012d9c1acf3b30 "VTY: integrate IMEI" Depends: Id2d2a3a93b033bafc74c62e15297034bf4aafe61 (libosmocore) Related: OS#2541 Change-Id: If232c80bea35d5c6864b889ae92d477eeaa3f45d
Diffstat (limited to 'sql')
-rw-r--r--sql/hlr.sql6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/hlr.sql b/sql/hlr.sql
index 9ff9867..10838f2 100644
--- a/sql/hlr.sql
+++ b/sql/hlr.sql
@@ -5,8 +5,10 @@ CREATE TABLE subscriber (
imsi VARCHAR(15) UNIQUE NOT NULL,
-- Chapter 2.1.2
msisdn VARCHAR(15) UNIQUE,
- -- Chapter 2.2.3: Most recent / current IMEI
+ -- Chapter 2.2.3: Most recent / current IMEISV
imeisv VARCHAR,
+ -- Chapter 2.1.9: Most recent / current IMEI
+ imei VARCHAR(14),
-- Chapter 2.4.5
vlr_number VARCHAR(15),
-- Chapter 2.4.6
@@ -74,4 +76,4 @@ CREATE UNIQUE INDEX idx_subscr_imsi ON subscriber (imsi);
-- Set HLR database schema version number
-- Note: This constant is currently duplicated in src/db.c and must be kept in sync!
-PRAGMA user_version = 1;
+PRAGMA user_version = 2;