aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte (local) <laflocal@hanuman.gnumonks.org>2009-12-27 11:13:15 +0100
committerHarald Welte (local) <laflocal@hanuman.gnumonks.org>2009-12-27 11:13:15 +0100
commit8b5b9b6d55e0880e15df3835d459575396814db3 (patch)
tree04a58648eaf71071787a063433133b51cf7f8d29
parent2a6f7af801be1ce7b32397082130a0693d250d85 (diff)
* don't skip authorized phones while syncing
* don't strip leading 9 from extension number
-rw-r--r--openbsc/src/debug.c6
-rwxr-xr-x[-rw-r--r--]openbsc/tools/26c3-guru-import.py16
2 files changed, 12 insertions, 10 deletions
diff --git a/openbsc/src/debug.c b/openbsc/src/debug.c
index acfcba30d..bc9230a93 100644
--- a/openbsc/src/debug.c
+++ b/openbsc/src/debug.c
@@ -35,13 +35,13 @@
/* default categories */
static struct debug_category default_categories[Debug_LastEntry] = {
[DRLL] = { .enabled = 1, .loglevel = LOGL_NOTICE },
- [DCC] = { .enabled = 1, .loglevel = LOGL_NOTICE },
+ [DCC] = { .enabled = 1, .loglevel = LOGL_INFO },
[DNM] = { .enabled = 1, .loglevel = LOGL_NOTICE },
[DRR] = { .enabled = 1, .loglevel = LOGL_NOTICE },
[DRSL] = { .enabled = 1, .loglevel = LOGL_NOTICE },
[DMM] = { .enabled = 1, .loglevel = LOGL_INFO },
[DMNCC] = { .enabled = 1, .loglevel = LOGL_NOTICE },
- [DSMS] = { .enabled = 1, .loglevel = LOGL_NOTICE },
+ [DSMS] = { .enabled = 1, .loglevel = LOGL_INFO },
[DPAG] = { .enabled = 1, .loglevel = LOGL_NOTICE },
[DMEAS] = { .enabled = 0, .loglevel = LOGL_NOTICE },
[DMI] = { .enabled = 0, .loglevel = LOGL_NOTICE },
@@ -51,7 +51,7 @@ static struct debug_category default_categories[Debug_LastEntry] = {
[DSCCP] = { .enabled = 1, .loglevel = LOGL_NOTICE },
[DMSC] = { .enabled = 1, .loglevel = LOGL_NOTICE },
[DMGCP] = { .enabled = 1, .loglevel = LOGL_NOTICE },
- [DHO] = { .enabled = 1, .loglevel = LOGL_NOTICE },
+ [DHO] = { .enabled = 1, .loglevel = LOGL_INFO },
[DDB] = { .enabled = 1, .loglevel = LOGL_NOTICE },
[DREF] = { .enabled = 0, .loglevel = LOGL_NOTICE },
};
diff --git a/openbsc/tools/26c3-guru-import.py b/openbsc/tools/26c3-guru-import.py
index 99a982b9f..4d85bcf3c 100644..100755
--- a/openbsc/tools/26c3-guru-import.py
+++ b/openbsc/tools/26c3-guru-import.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python2.6
+#!/usr/bin/python2.5
-# Based loosely on hlrsync.py from Jan Lübbe
+# Based loosely on hlrsync.py from Jan Luebbe
# (C) 2009 Daniel Willmann
# All Rights Reserved
#
@@ -48,13 +48,15 @@ for x in web_tuple:
# Test if it is an IMSI and hasn't yet been authorized
subscr = hlr.execute("""
- SELECT * FROM Subscriber WHERE imsi=="%015u" and authorized==0
+ SELECT * FROM Subscriber WHERE imsi=="%015u"
""" % (imxi) ).fetchall()
+ #and authorized==0
+
# Not an IMSI
if len(subscr) == 0:
equip = hlr.execute("""
- SELECT * FROM Equipment WHERE imei="%015u"
+ SELECT id,imei FROM Equipment WHERE imei="%015u"
""" % (imxi) ).fetchall();
#print equip
@@ -71,8 +73,9 @@ for x in web_tuple:
continue
subscr = hlr.execute("""
- SELECT * FROM Subscriber WHERE id==%u and authorized==0
+ SELECT * FROM Subscriber WHERE id==%u
""" % subscrid[0]['subscriber_id']).fetchall();
+ # and authorized==0
if len(subscr) == 0:
continue
@@ -82,9 +85,8 @@ for x in web_tuple:
print exten, imxi
print subscr
- # Strip leading 9 from extension and authorize subscriber
hlr.execute("""UPDATE Subscriber SET authorized = 1,extension="%s" \
WHERE id = %u
- """ % (str(exten)[1:], subscr['id']) );
+ """ % (str(exten), subscr['id']) );
hlr.close()