summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-08-16 16:48:07 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-08-24 15:42:37 +0200
commit070b2c66510eb2079c56a8f4a13130f494fd44be (patch)
treedef3bb812ed82e3a5b1629947f44ee4182636aa0
parent3f08ccfe79edfa75c6e0f7eb2068b6cc5014808a (diff)
osmo-bsc: fix handover (signalling only) and add VTX command to trigger
Add VTY commands to trigger a handover of an lchan/subscriber connection. Fix assertion problem / crash
-rw-r--r--openbsc/src/libbsc/bsc_vty.c81
-rw-r--r--openbsc/src/libbsc/handover_logic.c3
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_audio.c8
3 files changed, 90 insertions, 2 deletions
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 554b55298..159ec8277 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -56,6 +56,7 @@
#include <openbsc/pcu_if.h>
#include <openbsc/common_cs.h>
#include <openbsc/vlr.h>
+#include <openbsc/handover.h>
#include <inttypes.h>
@@ -1344,6 +1345,83 @@ DEFUN(show_lchan_summary,
return lchan_summary(vty, argc, argv, lchan_dump_short_vty);
}
+DEFUN(show_subscr_conn,
+ show_subscr_conn_cmd,
+ "show conns",
+ SHOW_STR "Display currently active subscriber connections\n")
+{
+ struct gsm_subscriber_connection *conn;
+ struct gsm_network *net = gsmnet_from_vty(vty);
+ bool no_conns = true;
+ unsigned int count = 0;
+
+ vty_out(vty, "Active subscriber connections: %s", VTY_NEWLINE);
+
+ llist_for_each_entry(conn, &net->subscr_conns, entry) {
+ vty_out(vty, "conn nr #%u:%s", count, VTY_NEWLINE);
+ lchan_dump_full_vty(vty, conn->lchan);
+ no_conns = false;
+ count++;
+ }
+
+ if (no_conns)
+ vty_out(vty, "None%s", VTY_NEWLINE);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(handover_subscr_conn,
+ handover_subscr_conn_cmd,
+ "handover conn-nr CONN_NR bts BTS",
+ "Handover subscriber connection\n"
+ "Subscriber connection index\n" "index\n" "BTS to handover to\n" "BTS\n")
+{
+ struct gsm_subscriber_connection *conn;
+ struct gsm_network *net = gsmnet_from_vty(vty);
+ unsigned int count = 0;
+ unsigned int conn_nr = atoi(argv[0]);
+ unsigned int bts_nr = atoi(argv[1]);
+ struct gsm_lchan *lchan;
+ struct gsm_bts *bts;
+ struct gsm_bts *new_bts = NULL;
+
+ /* Lookup the BTS where we want to handover to */
+ llist_for_each_entry(bts, &net->bts_list, list) {
+ if (bts->nr == bts_nr) {
+ new_bts = bts;
+ break;
+ }
+ }
+
+ if (!new_bts) {
+ vty_out(vty, "Unable to trigger handover,"
+ "specified bts #%u does not exist%s", bts_nr,
+ VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ /* Find the connection/lchan that we want to handover */
+ llist_for_each_entry(conn, &net->subscr_conns, entry) {
+ if (count == conn_nr) {
+ lchan = conn->lchan;
+ bts = conn->bts;
+
+ vty_out(vty, "starting handover for conn nr #%u...%s",
+ count, VTY_NEWLINE);
+ lchan_dump_full_vty(vty, lchan);
+ bsc_handover_start(lchan, new_bts);
+ return CMD_SUCCESS;
+ }
+ count++;
+ }
+
+ vty_out(vty, "Unable to trigger handover,"
+ "specified connection #%u does not exist%s", conn_nr,
+ VTY_NEWLINE);
+
+ return CMD_WARNING;
+}
+
static void paging_dump_vty(struct vty *vty, struct gsm_paging_request *pag)
{
vty_out(vty, "Paging on BTS %u%s", pag->bts->nr, VTY_NEWLINE);
@@ -4105,6 +4183,9 @@ int bsc_vty_init(struct gsm_network *network)
install_element_ve(&show_lchan_cmd);
install_element_ve(&show_lchan_summary_cmd);
+ install_element_ve(&show_subscr_conn_cmd);
+ install_element_ve(&handover_subscr_conn_cmd);
+
install_element_ve(&show_paging_cmd);
install_element_ve(&show_paging_group_cmd);
diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c
index c03563f6b..bf0836546 100644
--- a/openbsc/src/libbsc/handover_logic.c
+++ b/openbsc/src/libbsc/handover_logic.c
@@ -101,7 +101,8 @@ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts)
if (bsc_ho_by_old_lchan(old_lchan))
return -EBUSY;
- DEBUGP(DHO, "(old_lchan on BTS %u, new BTS %u)\n",
+ DEBUGP(DHO, "Beginning with handover operation"
+ "(old_lchan on BTS %u, new BTS %u) ...\n",
old_lchan->ts->trx->bts->nr, bts->nr);
rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]);
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_audio.c b/openbsc/src/osmo-bsc/osmo_bsc_audio.c
index 03cfce21a..b4ffa88f1 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_audio.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_audio.c
@@ -113,7 +113,13 @@ static int handle_abisip_signal(unsigned int subsys, unsigned int signal,
break;
case S_ABISIP_MDCX_ACK:
- if (is_ipaccess_bts(con->bts) && con->sccp_con->rtp_ip) {
+ if (con->ho_lchan) {
+ /* NOTE: When an ho_lchan exists, the MDCX is part of an
+ * handover operation (intra-bsc). This means we will not
+ * inform the MSC about the event, which means that no
+ * assignment complete message is transmitted */
+ LOGP(DMSC, LOGL_INFO," RTP connection handover complete\n");
+ } else if (is_ipaccess_bts(con->bts) && con->sccp_con->rtp_ip) {
/* NOTE: This is only relevant on AoIP networks with
* IPA based base stations. See also osmo_bsc_api.c,
* function bsc_assign_compl() */