From 00965dca2bd78cc57ddb3989b365226908ff1c31 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 30 May 2018 23:45:53 +0200 Subject: VTY: Print some more information in "show conns" We now print information such as * SCCP connection ID * MSC number * handover decision2 fail count * channel mode (SIGN/SPEECH) * MGW endpoint * secondary lchan (if any, e.g. during assignment) * don't crash if conn->lchan == NULL Change-Id: I2f8000844afc9da93ca39976399e5f76a45530de --- src/libbsc/bsc_vty.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index e53a14fa1..6c2257dec 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1515,6 +1515,18 @@ DEFUN(show_lchan_summary, return lchan_summary(vty, argc, argv, lchan_dump_short_vty); } +static void dump_one_subscr_conn(struct vty *vty, const struct gsm_subscriber_connection *conn) +{ + vty_out(vty, "conn ID=%u, MSC=%u, hodec2_fail=%d, mode=%s, mgw_ep=%s%s", + conn->sccp.conn_id, conn->sccp.msc->nr, conn->hodec2.failures, + get_value_string(gsm48_chan_mode_names, conn->user_plane.chan_mode), + conn->user_plane.mgw_endpoint, VTY_NEWLINE); + if (conn->lchan) + lchan_dump_full_vty(vty, conn->lchan); + if (conn->secondary_lchan) + lchan_dump_full_vty(vty, conn->secondary_lchan); +} + DEFUN(show_subscr_conn, show_subscr_conn_cmd, "show conns", @@ -1528,8 +1540,7 @@ DEFUN(show_subscr_conn, 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); + dump_one_subscr_conn(vty, conn); no_conns = false; count++; } -- cgit v1.2.1