aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2009-11-19 15:20:48 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2009-11-20 14:05:17 +0100
commit17e791666d527f83ad80b346ad58ecc39a913054 (patch)
tree3dde8f98330d9920812769fa80c4735747db502c /openbsc
parent5fddf475d522e73462472dadc9068aad698907ab (diff)
[mgcp] Add a show command for the mgcp...
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/bsc_mgcp.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/openbsc/src/bsc_mgcp.c b/openbsc/src/bsc_mgcp.c
index 4820465f7..4ebf6c84e 100644
--- a/openbsc/src/bsc_mgcp.c
+++ b/openbsc/src/bsc_mgcp.c
@@ -908,6 +908,23 @@ 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")
+{
+ int i;
+
+ vty_out(vty, "MGCP is up and running with %u endpoints:%s", number_endpoints - 1, VTY_NEWLINE);
+ for (i = 1; i < number_endpoints; ++i) {
+ struct mgcp_endpoint *endp = &endpoints[i];
+ vty_out(vty, " Endpoint 0x%.2x: CI: %d net: %u/%u bts: %u/%u%s",
+ i, endp->ci,
+ ntohs(endp->rtp), ntohs(endp->rtcp),
+ ntohs(endp->bts_rtp), ntohs(endp->bts_rtcp), VTY_NEWLINE);
+ }
+
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_mgcp,
cfg_mgcp_cmd,
"mgcp",
@@ -1028,6 +1045,9 @@ int bsc_vty_init(struct gsm_network *dummy)
cmd_init(1);
vty_init();
+ install_element(VIEW_NODE, &show_mgcp_cmd);
+
+
install_element(CONFIG_NODE, &cfg_mgcp_cmd);
install_node(&mgcp_node, config_write_mgcp);
install_default(MGCP_NODE);