aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-02-28 01:12:33 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-02-28 19:40:53 +0100
commitd011c9151284d0328d9ef2f02f10813b4f9cccf9 (patch)
tree1a7c7d2c47330b9b5451b5e31dd05eb012e45130
parent88ad7723b44026e85ef322b86c48a07601b106f2 (diff)
mgcp: Prepare the show mgcp command to work on multiple trunks
-rw-r--r--openbsc/src/mgcp/mgcp_vty.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/openbsc/src/mgcp/mgcp_vty.c b/openbsc/src/mgcp/mgcp_vty.c
index bf8b7d4b0..b9e20e785 100644
--- a/openbsc/src/mgcp/mgcp_vty.c
+++ b/openbsc/src/mgcp/mgcp_vty.c
@@ -92,16 +92,19 @@ static int config_write_mgcp(struct vty *vty)
return CMD_SUCCESS;
}
-DEFUN(show_mcgp, show_mgcp_cmd, "show mgcp",
- SHOW_STR "Display information about the MGCP Media Gateway")
+static void dump_trunk(struct vty *vty, struct mgcp_trunk_config *cfg)
{
int i;
- vty_out(vty, "MGCP is up and running with %u endpoints:%s",
- g_cfg->trunk.number_endpoints - 1, VTY_NEWLINE);
- for (i = 1; i < g_cfg->trunk.number_endpoints; ++i) {
- struct mgcp_endpoint *endp = &g_cfg->trunk.endpoints[i];
- vty_out(vty, " Endpoint 0x%.2x: CI: %d net: %u/%u bts: %u/%u on %s traffic received bts: %u/%u remote: %u/%u transcoder: %u/%u%s",
+ vty_out(vty, "%s trunk nr %d with %d endpoints:%s",
+ cfg->trunk_type == MGCP_TRUNK_VIRTUAL ? "Virtual" : "E1",
+ cfg->trunk_nr, cfg->number_endpoints - 1, VTY_NEWLINE);
+
+ for (i = 1; i < cfg->number_endpoints; ++i) {
+ struct mgcp_endpoint *endp = &cfg->endpoints[i];
+ vty_out(vty,
+ " Endpoint 0x%.2x: CI: %d net: %u/%u bts: %u/%u on %s "
+ "traffic received bts: %u/%u remote: %u/%u transcoder: %u/%u%s",
i, endp->ci,
ntohs(endp->net_end.rtp_port), ntohs(endp->net_end.rtcp_port),
ntohs(endp->bts_end.rtp_port), ntohs(endp->bts_end.rtcp_port),
@@ -111,7 +114,12 @@ DEFUN(show_mcgp, show_mgcp_cmd, "show mgcp",
endp->trans_net.packets, endp->trans_bts.packets,
VTY_NEWLINE);
}
+}
+DEFUN(show_mcgp, show_mgcp_cmd, "show mgcp",
+ SHOW_STR "Display information about the MGCP Media Gateway")
+{
+ dump_trunk(vty, &g_cfg->trunk);
return CMD_SUCCESS;
}