summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte (local) <laflocal@hanuman.gnumonks.org>2009-12-27 13:49:05 +0100
committerHarald Welte (local) <laflocal@hanuman.gnumonks.org>2009-12-27 13:49:05 +0100
commit5c6ad79a42e06a4f9263fbe952c22e17057a4212 (patch)
treefb3e7f28005e6789b828d2e8db8c2dd3f123e142
parent7f96ad5a197c95a54b14d3467851d27160f269e0 (diff)
compare only the first 14 digits of the IMEI since last digit is software version
-rwxr-xr-xopenbsc/tools/26c3-guru-import.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/openbsc/tools/26c3-guru-import.py b/openbsc/tools/26c3-guru-import.py
index 4d85bcf3c..b61a1f714 100755
--- a/openbsc/tools/26c3-guru-import.py
+++ b/openbsc/tools/26c3-guru-import.py
@@ -56,15 +56,15 @@ for x in web_tuple:
# Not an IMSI
if len(subscr) == 0:
equip = hlr.execute("""
- SELECT id,imei FROM Equipment WHERE imei="%015u"
- """ % (imxi) ).fetchall();
+ SELECT id,imei FROM Equipment WHERE imei LIKE "%014u%%"
+ """ % (imxi/10) ).fetchall();
#print equip
if len(equip) == 0:
continue
subscrid = hlr.execute("""
- SELECT * FROM EquipmentWatch WHERE equipment_id=%015u ORDER BY created LIMIT 1
+ SELECT * FROM EquipmentWatch WHERE equipment_id=%u ORDER BY created LIMIT 1
""" % (int(equip[0]['id'])) ).fetchall();
#print subscrid