Change in osmo-hlr[master]: SS/USSD: fix: properly (re)schedule SS session timeout

Vadim Yanitskiy gerrit-no-reply at
Fri Nov 30 17:18:50 UTC 2018

Vadim Yanitskiy has uploaded this change for review. (

Change subject: SS/USSD: fix: properly (re)schedule SS session timeout

SS/USSD: fix: properly (re)schedule SS session timeout

It may happen that either the MS or an ESME would become
unresponsive, e.g. due to a bug, or a dropped message. This
is why we have SS session timeout, that prevents keeping
'stalled' sessions forever.

For some reason, it wasn't properly resceduled in case of
subsequent SS/USSD activity, so the lifetime of a session
was limited. Let's properly (re)schedule it.

Change-Id: I11aeacf012b06d3d0b5cc6e64baecf857b645fda
Related: OS#3717
M src/hlr_ussd.c
1 file changed, 7 insertions(+), 3 deletions(-)

  git pull ssh:// refs/changes/49/12049/1

diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c
index 5991148..a20a168 100644
--- a/src/hlr_ussd.c
+++ b/src/hlr_ussd.c
@@ -208,10 +208,9 @@
 	OSMO_STRLCPY_ARRAY(ss->imsi, imsi);
 	ss->session_id = session_id;
+	/* Schedule self-destruction timer */
 	osmo_timer_setup(&ss->timeout, ss_session_timeout, ss);
-	/* NOTE: The timeout is currently not refreshed with subsequent messages
-	 * within the SS/USSD session. So X seconds after the initial SS message,
-	 * the session will timeout! */
 	if (g_hlr->ss_guard_timeout > 0)
 		osmo_timer_schedule(&ss->timeout, g_hlr->ss_guard_timeout, 0);
@@ -536,6 +535,11 @@
 				gsup->imsi, gsup->session_id);
 			goto out_err;
+		/* Reschedule self-destruction timer */
+		if (g_hlr->ss_guard_timeout > 0)
+			osmo_timer_schedule(&ss->timeout, g_hlr->ss_guard_timeout, 0);
 		if (ss_op_is_ussd(req.opcode)) {
 			/* dispatch unstructured SS to routing */
 			handle_ussd(conn, ss, gsup, &req);

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I11aeacf012b06d3d0b5cc6e64baecf857b645fda
Gerrit-Change-Number: 12049
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list