summaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/gsm_subscriber.c
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-06-30 10:25:49 +0200
committerHarald Welte <laforge@gnumonks.org>2016-07-09 19:52:54 +0000
commite6052c4cc756f7d3a5023a0ba57fe8d80783967c (patch)
tree477d30b6379ca349ce10b588f10c20e23baf717f /openbsc/src/libmsc/gsm_subscriber.c
parent9f8f9b80214fabfb3ac7674341c18a61a6ffcc5f (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/src/libmsc/gsm_subscriber.c')
-rw-r--r--openbsc/src/libmsc/gsm_subscriber.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c
index 1dc2cc26d..08198c765 100644
--- a/openbsc/src/libmsc/gsm_subscriber.c
+++ b/openbsc/src/libmsc/gsm_subscriber.c
@@ -26,6 +26,7 @@
#include <string.h>
#include <assert.h>
#include <time.h>
+#include <stdbool.h>
#include <osmocom/core/talloc.h>
@@ -203,10 +204,12 @@ void subscr_remove_request(struct subscr_request *request)
}
struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp,
- const char *imsi, uint64_t smin,
- uint64_t smax)
+ const char *imsi)
{
- struct gsm_subscriber *subscr = db_create_subscriber(imsi, smin, smax);
+ struct gsm_subscriber *subscr = db_create_subscriber(imsi,
+ sgrp->net->ext_min,
+ sgrp->net->ext_max,
+ sgrp->net->auto_assign_exten);
if (subscr)
subscr->group = sgrp;
return subscr;