aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorNico Golde <nico@ngolde.de>2011-02-22 17:54:47 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-02-24 14:48:57 +0100
commitb62b12398b2f03ea1f453e4e1790cf304eed56c1 (patch)
tree2448feabde1612a646d619de39eae44ad3174d8a /openbsc
parent11762459e83d3c1cfa77f019d6438ad0ae0ee7d7 (diff)
sms: introduce new command to trigger the sending process for specific subscribers only
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/vty_interface_layer3.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/openbsc/src/vty_interface_layer3.c b/openbsc/src/vty_interface_layer3.c
index a5752748..a38d15bb 100644
--- a/openbsc/src/vty_interface_layer3.c
+++ b/openbsc/src/vty_interface_layer3.c
@@ -206,6 +206,24 @@ DEFUN(show_subscr,
return CMD_SUCCESS;
}
+DEFUN(subscriber_send_pending_sms,
+ subscriber_send_pending_sms_cmd,
+ "subscriber " SUBSCR_TYPES " ID sms pending send",
+ SUBSCR_HELP "SMS Operations\n" "Send pending SMS\n")
+{
+ struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+ struct gsm_subscriber *subscr = get_subscr_by_argv(gsmnet, argv[0], argv[1]);
+ struct gsm_sms *sms;
+
+ sms = db_sms_get_unsent_by_subscr(gsmnet, subscr->id, UINT_MAX);
+ if (sms)
+ gsm411_send_sms_subscr(sms->receiver, sms);
+
+ subscr_put(subscr);
+
+ return CMD_SUCCESS;
+}
+
DEFUN(subscriber_send_sms,
subscriber_send_sms_cmd,
"subscriber " SUBSCR_TYPES " ID sms send .LINE",
@@ -766,6 +784,7 @@ int bsc_vty_init_extra(void)
install_element(ENABLE_NODE, &smsqueue_max_cmd);
install_element(ENABLE_NODE, &smsqueue_clear_cmd);
install_element(ENABLE_NODE, &smsqueue_fail_cmd);
+ install_element(ENABLE_NODE, &subscriber_send_pending_sms_cmd);
return 0;
}