From 1b44eaeffabae6f00da0c0faae66c0ebd78c1487 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Wed, 12 Jun 2013 08:39:32 +0200 Subject: HO: Allow assignment trigger via VTY command If handover is triggered without a BTS given, the handover logic will use assignment instead of handover. --- src/libmsc/vty_interface_layer3.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index d90b4c4f3..e46886086 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/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 */ -- cgit v1.2.3