summaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/gsm_04_08.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_04_08.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_04_08.c')
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 67044971b..1b02efe42 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -530,15 +530,13 @@ static int mm_tx_identity_req(struct gsm_subscriber_connection *conn, uint8_t id
static struct gsm_subscriber *subscr_create(const struct gsm_network *net,
const char *imsi)
{
- if (net->subscr_creation_mode == GSM_SUBSCR_DONT_CREATE)
+ if (!net->auto_create_subscr)
return NULL;
- if (net->subscr_creation_mode & GSM_SUBSCR_CREAT_W_REGEXP)
- if (!subscr_regexp_check(net, imsi))
- return NULL;
+ if (!subscr_regexp_check(net, imsi))
+ return NULL;
- return subscr_create_subscriber(net->subscr_group, imsi, net->ext_min,
- net->ext_max);
+ return subscr_create_subscriber(net->subscr_group, imsi);
}
/* Parse Chapter 9.2.11 Identity Response */