From 182fde503dfc01344c8f35777228d81777e204a2 Mon Sep 17 00:00:00 2001 From: Kurtis Heimerl Date: Fri, 21 Sep 2012 20:07:40 +0000 Subject: [PATCH] adding regex back into MobilityManagement for OpenRegistration. It's in the manual, we should have it in the code. git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4151 19bc5d8c-e614-43d4-8b26-e1612bc8e597 --- Control/MobilityManagement.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Control/MobilityManagement.cpp b/Control/MobilityManagement.cpp index 3b7a9ee..8e72155 100644 --- a/Control/MobilityManagement.cpp +++ b/Control/MobilityManagement.cpp @@ -186,7 +186,19 @@ void Control::LocationUpdatingController(const L3LocationUpdatingRequest* lur, L } // This allows us to configure Open Registration - bool openRegistration = gConfig.defines("Control.LUR.OpenRegistration"); + bool openRegistration = false; + if (gConfig.defines("Control.LUR.OpenRegistration")) { + if (!gConfig.defines("Control.LUR.OpenRegistration.Message")) { + gConfig.set("Control.LUR.OpenRegistration.Message","Welcome to the test network. Your IMSI is "); + } + Regexp rxp(gConfig.getStr("Control.LUR.OpenRegistration").c_str()); + openRegistration = rxp.match(IMSI); + if (gConfig.defines("Control.LUR.OpenRegistration.Reject")) { + Regexp rxpReject(gConfig.getStr("Control.LUR.OpenRegistration.Reject").c_str()); + bool openRegistrationReject = rxpReject.match(IMSI); + openRegistration = openRegistration && !openRegistrationReject; + } + } // Query for IMEI? if (gConfig.defines("Control.LUR.QueryIMEI")) {