diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-12-02 19:46:46 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-12-02 20:16:31 +0100 |
commit | a820ea1f67bab68136fbaae0108bb90c94b77b22 (patch) | |
tree | b9f94dd6ef8e4a1b3ee3388f52bdb32d1eeb2925 /src/db.c | |
parent | 8aa780bf80fa4ffde8a5df9d8b87a2e919193f1f (diff) |
implement removal of MSISDN
Add the first "official" way to remove the MSISDN from a subscriber entry, to
go back to 'MSISDN: none' like just after 'subscriber create'.
Add VTY command 'subscriber <ID> update msisdn none' to drop the MSISDN from
the subscriber. (Like 'subscriber <ID> update aud3g none')
Add DB_STMT_DELETE_MSISDN_BY_IMSI.
In db_subscr_update_msisdn_by_imsi(), allow passing a NULL msisdn, and if NULL,
call above delete SQL statement.
Change-Id: I15419105ea461137776adb92d384d8985210c90e
Diffstat (limited to 'src/db.c')
-rw-r--r-- | src/db.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -62,6 +62,7 @@ static const char *stmt_sql[] = { [DB_STMT_SUBSCR_CREATE] = "INSERT INTO subscriber (imsi) VALUES ($imsi)", [DB_STMT_DEL_BY_ID] = "DELETE FROM subscriber WHERE id = $subscriber_id", [DB_STMT_SET_MSISDN_BY_IMSI] = "UPDATE subscriber SET msisdn = $msisdn WHERE imsi = $imsi", + [DB_STMT_DELETE_MSISDN_BY_IMSI] = "UPDATE subscriber SET msisdn = NULL WHERE imsi = $imsi", [DB_STMT_AUC_2G_INSERT] = "INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki)" " VALUES($subscriber_id, $algo_id_2g, $ki)", |