From 8000e0ea509c5a4488a5d1878f465418d32b7fdb Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Tue, 27 Jan 2015 14:56:40 +0100 Subject: gprs: Support cancellation type The cancellation type that is part of the UpdateCancellation message is currently ignored. This patch adds the missing glue between the existing GSUP and GMM support. If the type is not present or has the value updateProcedure the subcriber and MM context are siliently removed. Otherwise, a message with cause 'implicitly detached' is sent to the MS. Since the real cause is not known (the specification neither added a cause IE nor defined a static cause value), the MS may get the real cause in the following AttachRej. Added VTY commands: - update-subscriber imsi IMSI cancel update-procedure - update-subscriber imsi IMSI cancel subscription-withdraw the old form without the cause is no longer supported. Sponsored-by: On-Waves ehf --- openbsc/src/gprs/sgsn_vty.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'openbsc/src/gprs/sgsn_vty.c') diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c index 1ecb2eae3..ba71555ec 100644 --- a/openbsc/src/gprs/sgsn_vty.c +++ b/openbsc/src/gprs/sgsn_vty.c @@ -545,11 +545,14 @@ failed: } DEFUN(update_subscr_cancel, update_subscr_cancel_cmd, - UPDATE_SUBSCR_STR "cancel", + UPDATE_SUBSCR_STR "cancel (update-procedure|subscription-withdraw)", UPDATE_SUBSCR_HELP - "Cancel (remove) subscriber record\n") + "Cancel (remove) subscriber record\n" + "The MS moved to another SGSN\n" + "The subscription is no longer valid\n") { const char *imsi = argv[0]; + const char *cancel_type = argv[1]; struct gsm_subscriber *subscr; @@ -560,6 +563,11 @@ DEFUN(update_subscr_cancel, update_subscr_cancel_cmd, return CMD_WARNING; } + if (strcmp(cancel_type, "update-procedure") == 0) + subscr->sgsn_data->error_cause = SGSN_ERROR_CAUSE_NONE; + else + subscr->sgsn_data->error_cause = GMM_CAUSE_IMPL_DETACHED; + gprs_subscr_cancel(subscr); subscr_put(subscr); @@ -606,6 +614,7 @@ DEFUN(update_subscr_destroy, update_subscr_destroy_cmd, } subscr->keep_in_ram = 0; + subscr->sgsn_data->error_cause = SGSN_ERROR_CAUSE_NONE; gprs_subscr_cancel(subscr); if (subscr->use_count > 1) vty_out(vty, "%% subscriber is still in use%s", -- cgit v1.2.3