Change in osmo-msc[master]: vty: add cmd subscriber ID sms delete-all

Neels Hofmeyr gerrit-no-reply at
Mon Mar 11 04:50:56 UTC 2019

Neels Hofmeyr has submitted this change and it was merged. ( )

Change subject: vty: add cmd subscriber ID sms delete-all

vty: add cmd subscriber ID sms delete-all

In ttcn3-msc-tests, so far we leave an intentionally failed MT SMS in the SMS
queue, which may cause it to re-appear in subsequent tests.

Allow removing all SMS for a given subscriber from the SMS database for good.

(I dimly remember a user report where the SMS queue spams failed SMS attempts,
and the only way to get rid of SMS for a given subscriber is to tamper with the
sms.db file directly. This should no longer be necessary with this command.)

Related: I7dce12942a65eaaf97f78ca69401c7f93faacb9e (osmo-ttcn3-hacks)
Change-Id: I637cbd7adc075a192f49752b38779391472ff06d
M src/libmsc/msc_vty.c
1 file changed, 25 insertions(+), 0 deletions(-)

  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved
  Vadim Yanitskiy: Looks good to me, but someone else must approve

diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index 2adb2a4..ac3946a 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -959,6 +959,30 @@
 	return CMD_SUCCESS;
+      subscriber_sms_delete_all_cmd,
+      "subscriber " SUBSCR_TYPES " ID sms delete-all",
+      SUBSCR_HELP "SMS Operations\n"
+      "Delete all SMS to be delivered to this subscriber"
+      " -- WARNING: the SMS data for all unsent SMS for this subscriber"
+      " WILL BE LOST.\n")
+	struct vlr_subscr *vsub;
+	vsub = get_vsub_by_argv(gsmnet, argv[0], argv[1]);
+	if (!vsub) {
+		vty_out(vty, "%% No subscriber found for %s %s%s",
+			argv[0], argv[1], VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+	db_sms_delete_by_msisdn(vsub->msisdn);
+	vlr_subscr_put(vsub);
+	return CMD_SUCCESS;
       "subscriber " SUBSCR_TYPES " ID sms sender " SUBSCR_TYPES " SENDER_ID send .LINE",
@@ -1651,6 +1675,7 @@
 	install_element(ENABLE_NODE, &smsqueue_clear_cmd);
 	install_element(ENABLE_NODE, &smsqueue_fail_cmd);
 	install_element(ENABLE_NODE, &subscriber_send_pending_sms_cmd);
+	install_element(ENABLE_NODE, &subscriber_sms_delete_all_cmd);
 	install_element(CONFIG_NODE, &cfg_mncc_int_cmd);
 	install_node(&mncc_int_node, config_write_mncc_int);

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I637cbd7adc075a192f49752b38779391472ff06d
Gerrit-Change-Number: 13174
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at>
Gerrit-Reviewer: Harald Welte <laforge at>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list