summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2013-10-04 02:02:10 +0200
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2013-10-04 02:05:47 +0200
commitd08c440596b5faf6e2bec23149680a5eaa4963a6 (patch)
tree2182718d4f38ae566bdde0930a24a7b84553a1d8
parent7a72f64dc62fddc19628bc23b960d719644d45f9 (diff)
Add "subscriber create" VTY command.
It may be useful in production, but it's really required for VTY testing of subscriber related commands.
-rw-r--r--openbsc/src/libmsc/vty_interface_layer3.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index d90b4c4f3..5ef449790 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -218,6 +218,32 @@ DEFUN(show_subscr,
return CMD_SUCCESS;
}
+DEFUN(subscriber_create,
+ subscriber_create_cmd,
+ "subscriber create imsi ID",
+ "Operations on a Subscriber\n" \
+ "Create new subscriber\n" \
+ "Identify the subscriber by his IMSI\n" \
+ "Identifier for the subscriber\n")
+{
+ struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+ struct gsm_subscriber *subscr;
+
+ subscr = db_create_subscriber(gsmnet, argv[0]);
+ if (!subscr) {
+ vty_out(vty, "%% No subscriber created for IMSI %s%s",
+ argv[0], VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ /* Show info about the created subscriber. */
+ subscr_dump_full_vty(vty, subscr, 0);
+
+ subscr_put(subscr);
+
+ return CMD_SUCCESS;
+}
+
DEFUN(subscriber_send_pending_sms,
subscriber_send_pending_sms_cmd,
"subscriber " SUBSCR_TYPES " ID sms pending-send",
@@ -910,6 +936,7 @@ int bsc_vty_init_extra(void)
install_element_ve(&sms_send_pend_cmd);
+ install_element_ve(&subscriber_create_cmd);
install_element_ve(&subscriber_send_sms_cmd);
install_element_ve(&subscriber_silent_sms_cmd);
install_element_ve(&subscriber_silent_call_start_cmd);