aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-02-28 12:27:47 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-02-28 19:40:53 +0100
commitcdba04978d0bb4e54b7e9c33717e30c5f864b4e2 (patch)
tree08d3f6c3fcb2403af1a17cf5d69cf472cf017c76 /openbsc/src
parent0e939fec4237483df4c51fb58c87f35b3115db50 (diff)
mgcp: Make show mgcp print the new trunks we have.
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/mgcp/mgcp_vty.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/openbsc/src/mgcp/mgcp_vty.c b/openbsc/src/mgcp/mgcp_vty.c
index 7052e8471..88c097d9c 100644
--- a/openbsc/src/mgcp/mgcp_vty.c
+++ b/openbsc/src/mgcp/mgcp_vty.c
@@ -114,6 +114,11 @@ static void dump_trunk(struct vty *vty, struct mgcp_trunk_config *cfg)
cfg->trunk_type == MGCP_TRUNK_VIRTUAL ? "Virtual" : "E1",
cfg->trunk_nr, cfg->number_endpoints - 1, VTY_NEWLINE);
+ if (!cfg->endpoints) {
+ vty_out(vty, "No endpoints allocated yet.%s", VTY_NEWLINE);
+ return;
+ }
+
for (i = 1; i < cfg->number_endpoints; ++i) {
struct mgcp_endpoint *endp = &cfg->endpoints[i];
vty_out(vty,
@@ -133,7 +138,13 @@ static void dump_trunk(struct vty *vty, struct mgcp_trunk_config *cfg)
DEFUN(show_mcgp, show_mgcp_cmd, "show mgcp",
SHOW_STR "Display information about the MGCP Media Gateway")
{
+ struct mgcp_trunk_config *trunk;
+
dump_trunk(vty, &g_cfg->trunk);
+
+ llist_for_each_entry(trunk, &g_cfg->trunks, entry)
+ dump_trunk(vty, trunk);
+
return CMD_SUCCESS;
}