diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-09-14 02:03:13 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-09-18 12:37:34 +0000 |
commit | 550c55203dc346c2d454dfb8c246c023851c74f5 (patch) | |
tree | 8835df2983aed140bd5aa9393906ac195db5e8fb | |
parent | 5712864b4c77c1f38dc3a193f18cb3dc998b1d44 (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.
-rw-r--r-- | src/mgcp_ss7_vty.c | 19 |
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, ×lot); + + 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); |