aboutsummaryrefslogtreecommitdiffstats
path: root/src/mgcp
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-09-14 01:42:22 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-09-14 01:58:40 +0200
commitdea0ccc7fcf056a9cbdac8bcf13b31f3149fd77d (patch)
treeccfb52d9ae3973d828f038cb79a938136e25f828 /src/mgcp
parentc2bb077a489863cd6352298bff2eb510a4a22133 (diff)
mgcp: Add VTY commands to block endpoints instead of having this hardcoded
Instead of assuming which endpoints are blocked there is now a VTY command to block those. Clean up the init of the trunks, the only difference between Virtual and E1 is in the way to calculate the start port. Reduce the number of endpoints to 32, 31 is the last one that can be used on the E1 trunk, otherwise we move into TS 0 of the following trunk.
Diffstat (limited to 'src/mgcp')
-rw-r--r--src/mgcp/mgcp_protocol.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mgcp/mgcp_protocol.c b/src/mgcp/mgcp_protocol.c
index cae05da..19e9d4f 100644
--- a/src/mgcp/mgcp_protocol.c
+++ b/src/mgcp/mgcp_protocol.c
@@ -932,7 +932,7 @@ struct mgcp_trunk_config *mgcp_trunk_alloc(struct mgcp_config *cfg, int nr)
trunk->trunk_type = MGCP_TRUNK_E1;
trunk->trunk_nr = nr;
trunk_init(trunk);
- trunk->number_endpoints = 33;
+ trunk->number_endpoints = 32;
llist_add_tail(&trunk->entry, &cfg->trunks);
return trunk;
}
@@ -986,6 +986,8 @@ int mgcp_endpoints_allocate(struct mgcp_trunk_config *tcfg)
if (!tcfg->endpoints)
return -1;
+ tcfg->endpoints[0].blocked = 1;
+
for (i = 0; i < tcfg->number_endpoints; ++i) {
tcfg->endpoints[i].ci = CI_UNUSED;
tcfg->endpoints[i].cfg = tcfg->cfg;