aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2019-03-06 16:19:50 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2019-03-08 04:51:18 +0100
commitf90496f577e78944ce8db1aa5b900477c1e479b0 (patch)
tree9511d527970f4efcae206c7b864667c5aca5331c
parent34a36da3ef22d60f127308facf49e94a3615ec7e (diff)
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
-rw-r--r--src/libmsc/msc_vty.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index 2adb2a45c..ac3946afb 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -959,6 +959,30 @@ DEFUN(subscriber_send_pending_sms,
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 @@ void msc_vty_init(struct gsm_network *msc_network)
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);