From f5f512cc5945d069b3ffdea1fba6da5ab35bdfac Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 7 Jun 2010 17:56:32 +0200 Subject: [PATCH] GSM 04.08: Improve IMEI recording in hlr.sqlite3 for rejected subscribers If we send the IDENTITY REQUEST for IMEI before sending the IDENTITY REQUEST for IMSI, the probability is higher that we receive the IMEI response and associate it with the respective subscriber. --- openbsc/src/gsm_04_08.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c index 06e19ac0a..b17e1da07 100644 --- a/openbsc/src/gsm_04_08.c +++ b/openbsc/src/gsm_04_08.c @@ -389,10 +389,6 @@ static int mm_rx_loc_upd_req(struct msgb *msg) break; case GSM_MI_TYPE_TMSI: DEBUGPC(DMM, "\n"); - /* we always want the IMEI, too */ - rc = mm_tx_identity_req(lchan, GSM_MI_TYPE_IMEI); - conn->loc_operation->waiting_for_imei = 1; - /* look up the subscriber based on TMSI, request IMSI if it fails */ subscr = subscr_get_by_tmsi(bts->network, tmsi_from_string(mi_string)); @@ -401,6 +397,9 @@ static int mm_rx_loc_upd_req(struct msgb *msg) rc = mm_tx_identity_req(lchan, GSM_MI_TYPE_IMSI); conn->loc_operation->waiting_for_imsi = 1; } + /* we always want the IMEI, too */ + rc = mm_tx_identity_req(lchan, GSM_MI_TYPE_IMEI); + conn->loc_operation->waiting_for_imei = 1; break; case GSM_MI_TYPE_IMEI: case GSM_MI_TYPE_IMEISV: