summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-06-12 08:39:32 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2013-07-29 12:44:48 +0200
commit9da656969950b93e530087796faaaea193ebb724 (patch)
tree642c4c527fad9ed6565f1a59d8e3ae19d20c20d0
parent3eac7a4567703822d2e8acca21c228bad933f074 (diff)
HO: Allow assignment trigger via VTY command
If handover is triggered without a BTS given, the handover logic will use assignment instead of handover.
-rw-r--r--openbsc/src/libmsc/vty_interface_layer3.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index d90b4c4f3..e46886086 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -588,13 +588,14 @@ DEFUN(ena_subscr_kick,
DEFUN(ena_subscr_handover,
ena_subscr_handover_cmd,
- "subscriber " SUBSCR_TYPES " ID handover BTS_NR",
- SUBSCR_HELP "Handover the active connection\n"
+ "subscriber " SUBSCR_TYPES " ID handover [BTS_NR]",
+ SUBSCR_HELP "Handover the active connection (if BTS is given) or do "
+ "assignment (if BTS is not given)\n"
"Number of the BTS to handover to\n")
{
int ret;
struct gsm_subscriber_connection *conn;
- struct gsm_bts *bts;
+ struct gsm_bts *bts = NULL;
struct gsm_network *gsmnet = gsmnet_from_vty(vty);
struct gsm_subscriber *subscr =
get_subscr_by_argv(gsmnet, argv[0], argv[1]);
@@ -613,12 +614,14 @@ DEFUN(ena_subscr_handover,
return CMD_WARNING;
}
- bts = gsm_bts_num(gsmnet, atoi(argv[2]));
- if (!bts) {
- vty_out(vty, "%% BTS with number(%d) could not be found.%s",
- atoi(argv[2]), VTY_NEWLINE);
- subscr_put(subscr);
- return CMD_WARNING;
+ if (argc > 2) {
+ bts = gsm_bts_num(gsmnet, atoi(argv[2]));
+ if (!bts) {
+ vty_out(vty, "%% BTS with number(%d) could not be "
+ "found.%s", atoi(argv[2]), VTY_NEWLINE);
+ subscr_put(subscr);
+ return CMD_WARNING;
+ }
}
/* now start the handover */