aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-09-26 18:38:36 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-09-26 18:49:02 +0800
commit6f926f0197953f86c2060a56ba8a6c1f00d88b64 (patch)
tree0f9190d694b5cf6fb7fa3d5233d3bead573d5990 /openbsc
parentc98d67d592c82603b436fb7a641f8dad8e7ad3d7 (diff)
bsc: Add a ussd_welcome_text variable and VTY command
Add a command to set the welcome text for the USSD.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/gsm_data.h1
-rw-r--r--openbsc/src/vty_interface.c17
2 files changed, 18 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index ec946aa3c..6988a8dc3 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -704,6 +704,7 @@ struct gsm_network {
int pong_timeout;
struct osmo_bsc_rf *rf;
char *ussd_grace_txt;
+ char *ussd_welcome_txt;
};
#define SMS_HDR_SIZE 128
diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c
index 64256b29c..ff4c03d27 100644
--- a/openbsc/src/vty_interface.c
+++ b/openbsc/src/vty_interface.c
@@ -1462,6 +1462,22 @@ DEFUN(cfg_net_grace_ussd,
return CMD_SUCCESS;
}
+DEFUN(cfg_net_welcome_ussd,
+ cfg_net_welcome_ussd_cmd,
+ "bsc-welcome-txt .TEXT",
+ "Set the USSD notification to be sent.\n" "Text to be sent\n")
+{
+ char *data = argv_concat(argv, argc, 1);
+ if (!data)
+ return CMD_WARNING;
+
+ if (gsmnet->ussd_welcome_txt)
+ talloc_free(gsmnet->ussd_welcome_txt);
+ gsmnet->ussd_welcome_txt = talloc_strdup(gsmnet, data);
+ talloc_free(data);
+ return CMD_SUCCESS;
+}
+
#define DECLARE_TIMER(number, doc) \
DEFUN(cfg_net_T##number, \
cfg_net_T##number##_cmd, \
@@ -2285,6 +2301,7 @@ int bsc_vty_init(struct gsm_network *net)
install_element(GSMNET_NODE, &cfg_net_ping_time_cmd);
install_element(GSMNET_NODE, &cfg_net_pong_time_cmd);
install_element(GSMNET_NODE, &cfg_net_grace_ussd_cmd);
+ install_element(GSMNET_NODE, &cfg_net_welcome_ussd_cmd);
install_element(GSMNET_NODE, &cfg_bts_cmd);
install_node(&bts_node, config_write_bts);