aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/gsm_04_08.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-06-30 15:30:47 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-07-27 21:39:13 +0200
commite7bd863f763809b152fb21655abe7e8bba557561 (patch)
treedd6b2a11d9aeec000ebbbb44ed178d4a0dfd0970 /openbsc/src/libmsc/gsm_04_08.c
parentb97089432f43505329b57630c5520d555ec998d1 (diff)
expiration: Speculative fixes for the periodic expiring handling
We were expiring subscribers during active calls. This is because the T3212 is stopped under certain conditions but we didn't stop that timer at all. Remember if T3212 timer was stopped due something done by NITB and update the expiration time at the end of the radio connection, as the phone should restart it when returning to MM Idle. It is a bit difficult to decide when we should set the flag. E.g. in a CM Service Request we don't know if we accept the service and during a LU we already send MM messages before we accept or reject the subscriber. The easiest is to set the flag when receiving a paging response on known subscribers and at the end of the authentication process. Do not expire a subscriber that has an active connection that is marked with the flag, e.g. we would still expire a subscriber that is being paged. Manual tests executed/passed: * gst LUTest.st verified that a expiration date was set * gst SMSTest.st (doing another LU but forcing a timeout on the SMS sending). Verified that the expire_lu was updated.
Diffstat (limited to 'openbsc/src/libmsc/gsm_04_08.c')
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 7f38be28e..eea073614 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -829,6 +829,9 @@ static int _gsm48_rx_mm_serv_req_sec_cb(
struct gsm_subscriber_connection *conn = data;
int rc = 0;
+ /* auth failed or succeeded, the timer was stopped */
+ conn->expire_timer_stopped = 1;
+
switch (event) {
case GSM_SECURITY_AUTH_FAILED:
/* Nothing to do */
@@ -930,6 +933,9 @@ static int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct m
memcpy(subscr->equipment.classmark2, classmark2, classmark2_len);
db_sync_equipment(&subscr->equipment);
+ /* we will send a MM message soon */
+ conn->expire_timer_stopped = 1;
+
return gsm48_secure_channel(conn, req->cipher_key_seq,
_gsm48_rx_mm_serv_req_sec_cb, NULL);
}
@@ -1123,6 +1129,9 @@ static int gsm48_rx_rr_pag_resp(struct gsm_subscriber_connection *conn, struct m
memcpy(subscr->equipment.classmark2, classmark2_lv+1, *classmark2_lv);
db_sync_equipment(&subscr->equipment);
+ /* We received a paging */
+ conn->expire_timer_stopped = 1;
+
rc = gsm48_handle_paging_resp(conn, msg, subscr);
return rc;
}