aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/vty_interface.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-08-08 16:03:15 +0200
committerHarald Welte <laforge@gnumonks.org>2009-08-08 16:03:15 +0200
commit76042188e09d2ea5f138474ade70e1f74f317aea (patch)
treee5575789a35674ee676ece472b75394d2e283f76 /openbsc/src/vty_interface.c
parent1d014a5dfc45fb09cec28a7327b36ae53458ca8e (diff)
first 'working' SMS implementation
we now have the full path from the MS into the database (SUBMIT), as well as back from the database to the MS (DELIVER). The database gets correctly updated once a SMS has been successfully delivered. What's still missing is the periodic scan over all undelivered messages, trying to deliver them to the respective MS. So far, you have to manually trigger this on the telnet interface with 'sms send pending 1'
Diffstat (limited to 'openbsc/src/vty_interface.c')
-rw-r--r--openbsc/src/vty_interface.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c
index e1914437a..00b1df2b7 100644
--- a/openbsc/src/vty_interface.c
+++ b/openbsc/src/vty_interface.c
@@ -954,6 +954,52 @@ DEFUN(show_subscr,
return CMD_SUCCESS;
}
+DEFUN(sms_send_pend,
+ sms_send_pend_cmd,
+ "sms send pending MIN_ID",
+ "Send all pending SMS starting from MIN_ID")
+{
+ struct gsm_sms *sms;
+
+ sms = db_sms_get_unsent(gsmnet, atoi(argv[0]));
+ if (!sms)
+ return CMD_WARNING;
+
+ if (!sms->receiver) {
+ sms_free(sms);
+ return CMD_WARNING;
+ }
+
+ gsm411_send_sms_subscr(sms->receiver, sms);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(sms_send_ext,
+ sms_send_ext_cmd,
+ "sms send extension EXTEN .LINE",
+ "Send a message to a subscriber identified by EXTEN")
+{
+ struct gsm_sms *sms;
+
+ //gsm411_send_sms_subscr(sms->receiver, sms);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(sms_send_imsi,
+ sms_send_imsi_cmd,
+ "sms send imsi IMSI .LINE",
+ "Send a message to a subscriber identified by IMSI")
+{
+ struct gsm_sms *sms;
+
+ //gsm411_send_sms_subscr(sms->receiver, sms);
+
+ return CMD_SUCCESS;
+}
+
+
DEFUN(cfg_subscr_name,
cfg_subscr_name_cmd,
"name NAME",
@@ -1023,6 +1069,12 @@ int bsc_vty_init(struct gsm_network *net)
install_element(VIEW_NODE, &show_subscr_cmd);
+ install_element(VIEW_NODE, &sms_send_pend_cmd);
+#if 0
+ install_element(VIEW_NODE, &sms_send_ext_cmd);
+ install_element(VIEW_NODE, &sms_send_imsi_cmd);
+#endif
+
install_element(CONFIG_NODE, &cfg_bts_cmd);
install_node(&bts_node, config_write_bts);
install_default(BTS_NODE);