diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-03-21 15:14:04 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-03-21 15:14:04 +0100 |
commit | 8e6d4c3414cbc6105131b58213aa32f0defb288a (patch) | |
tree | 2087da75d7726a07e9ca887ea7023121aa823222 | |
parent | e0dc3e5276e0f22eb5cdd5dc19f544de9ee99777 (diff) |
mgcp: Check if the endpoint is blocked and then reject it
Instead of hardcoding which timeslot is blocked we will just
use the blocked flag in an endpoint. This should fix call
handling for CIC on the trunk config.
-rw-r--r-- | src/mgcp_ss7.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mgcp_ss7.c b/src/mgcp_ss7.c index 2c93084..5621e28 100644 --- a/src/mgcp_ss7.c +++ b/src/mgcp_ss7.c @@ -499,21 +499,20 @@ static int ss7_delete_endpoint(struct mgcp_ss7 *ss7, struct mgcp_endpoint *endp) static int mgcp_ss7_policy(struct mgcp_trunk_config *tcfg, int endp_no, int state, const char *trans) { int rc; - int multiplex, timeslot; struct mgcp_ss7 *ss7; struct mgcp_endpoint *endp; - mgcp_endpoint_to_timeslot(endp_no, &multiplex, ×lot); - /* these endpoints are blocked */ - if (timeslot == 0 || timeslot >= 0x1F) { - LOGP(DMGCP, LOGL_NOTICE, "Rejecting non voice timeslots %d\n", timeslot); - return MGCP_POLICY_REJECT; - } endp = &tcfg->endpoints[endp_no]; ss7 = (struct mgcp_ss7 *) tcfg->cfg->data; + /* these endpoints are blocked */ + if (endp->blocked) { + LOGP(DMGCP, LOGL_NOTICE, "Rejecting non voice timeslots 0x%x\n", endp_no); + return MGCP_POLICY_REJECT; + } + /* TODO: Make it async and wait for the port to be connected */ rc = MGCP_POLICY_REJECT; switch (state) { |