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

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Mar 7 15:53:19 UTC 2019


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13174


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 also 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/74/13174/1

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;
 }
 
+DEFUN(subscriber_sms_delete_all,
+      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;
+}
+
 DEFUN(subscriber_send_sms,
       subscriber_send_sms_cmd,
       "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 https://gerrit.osmocom.org/13174
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I637cbd7adc075a192f49752b38779391472ff06d
Gerrit-Change-Number: 13174
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190307/5b05bbaa/attachment.html>


More information about the gerrit-log mailing list