From 5c6ad79a42e06a4f9263fbe952c22e17057a4212 Mon Sep 17 00:00:00 2001 From: "Harald Welte (local)" Date: Sun, 27 Dec 2009 13:49:05 +0100 Subject: compare only the first 14 digits of the IMEI since last digit is software version --- openbsc/tools/26c3-guru-import.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'openbsc/tools') 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 -- cgit v1.2.3