aboutsummaryrefslogtreecommitdiffstats
path: root/src/mgcp_ss7_vty.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-09-14 02:03:13 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-09-14 22:28:13 +0200
commit42e44a9e5e88e32ad2dc218983f317bbec07cce4 (patch)
tree8e9bef66ac6ecb4518de25c47578be12e384b003 /src/mgcp_ss7_vty.c
parentdea0ccc7fcf056a9cbdac8bcf13b31f3149fd77d (diff)
mgcp: Introduce a command that will just block the default ports
It can be difficult to find the Timeslot/Multiplex for a higher number virtual trunk. This would be used by default, but normally the endpoint would be blocked on the switch already.
Diffstat (limited to 'src/mgcp_ss7_vty.c')
-rw-r--r--src/mgcp_ss7_vty.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mgcp_ss7_vty.c b/src/mgcp_ss7_vty.c
index a1fa86e..e9c79dc 100644
--- a/src/mgcp_ss7_vty.c
+++ b/src/mgcp_ss7_vty.c
@@ -191,6 +191,24 @@ DEFUN(cfg_mgcp_timeslot_block, cfg_mgcp_timeslot_block_cmd,
return CMD_SUCCESS;
}
+DEFUN(cfg_mgcp_block_defaults, cfg_mgcp_block_defaults_cmd,
+ "block-defaults",
+ "Block the default endpoints 0x0 and 0x1F\n")
+{
+ int i;
+
+ for (i = 1; i < g_cfg->trunk.number_endpoints; ++i) {
+ int multiplex, timeslot;
+ struct mgcp_endpoint *endp = &g_cfg->trunk.endpoints[i];
+ mgcp_endpoint_to_timeslot(ENDPOINT_NUMBER(endp), &multiplex, &timeslot);
+
+ if (timeslot == 0x0 || timeslot == 0x1F)
+ endp->blocked = 1;
+ }
+
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_trunk_vad, cfg_trunk_vad_cmd,
"vad (enabled|disabled)",
"Enable the Voice Activity Detection\n"
@@ -442,6 +460,7 @@ void mgcp_mgw_vty_init(void)
install_element(MGCP_NODE, &cfg_mgcp_endp_offset_cmd);
install_element(MGCP_NODE, &cfg_mgcp_target_trunk_cmd);
install_element(MGCP_NODE, &cfg_mgcp_timeslot_block_cmd);
+ install_element(MGCP_NODE, &cfg_mgcp_block_defaults_cmd);
install_element(TRUNK_NODE, &cfg_trunk_vad_cmd);
install_element(TRUNK_NODE, &cfg_trunk_realloc_cmd);