diff options
author | Max <msuraev@sysmocom.de> | 2016-06-30 10:25:49 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-07-09 19:52:54 +0000 |
commit | e6052c4cc756f7d3a5023a0ba57fe8d80783967c (patch) | |
tree | 477d30b6379ca349ce10b588f10c20e23baf717f /openbsc/include/openbsc/db.h | |
parent | 9f8f9b80214fabfb3ac7674341c18a61a6ffcc5f (diff) |
Make random MSISDN assignment optional
Previously if subscriber was automatically created it got assigned
random MSISDN number. Make it optional (defaulting to previous behavior)
by adding following:
* new optional no-extension argument for subscriber-create-on-demand vty
command
* db unit tests
* vty test
Note: using the db made with new code might result in subscribers with
empty extension. Such subscribers cannot be deleted using old
code. Make sure not to mix db versions or manually fix it by editing
sqlite with external program.
Fixes: OS#1658
Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb
Diffstat (limited to 'openbsc/include/openbsc/db.h')
-rw-r--r-- | openbsc/include/openbsc/db.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/db.h b/openbsc/include/openbsc/db.h index 6ffe1ade9..bb90705ab 100644 --- a/openbsc/include/openbsc/db.h +++ b/openbsc/include/openbsc/db.h @@ -20,6 +20,8 @@ #ifndef _DB_H #define _DB_H +#include <stdbool.h> + #include "gsm_subscriber.h" struct gsm_equipment; @@ -36,7 +38,7 @@ int db_fini(void); /* subscriber management */ struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, - uint64_t smax); + uint64_t smax, bool alloc_exten); struct gsm_subscriber *db_get_subscriber(enum gsm_subscriber_field field, const char *subscr); int db_sync_subscriber(struct gsm_subscriber *subscriber); |