aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/mgcp/mgcp_protocol.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-01-07 11:30:21 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-01-07 11:34:50 +0100
commitf43f2fce82fd115c88b6e50837b41f480e9b384e (patch)
tree2d05da463752d0db4baddda4d53daaa81c1cb958 /openbsc/src/mgcp/mgcp_protocol.c
parent9f239a2a0f8b53eb10a7226271eb599ddbfcffb6 (diff)
mgcp: We want to count trunks starting from one.
Diffstat (limited to 'openbsc/src/mgcp/mgcp_protocol.c')
-rw-r--r--openbsc/src/mgcp/mgcp_protocol.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/openbsc/src/mgcp/mgcp_protocol.c b/openbsc/src/mgcp/mgcp_protocol.c
index f9d723ad7..32f467b5a 100644
--- a/openbsc/src/mgcp/mgcp_protocol.c
+++ b/openbsc/src/mgcp/mgcp_protocol.c
@@ -272,14 +272,14 @@ static struct mgcp_endpoint *find_e1_endpoint(struct mgcp_config *cfg,
int trunk, endp, mgcp_endp;
trunk = strtoul(mgcp + 6, &rest, 10);
- if (rest == NULL || rest[0] != '/') {
+ if (rest == NULL || rest[0] != '/' || trunk < 1) {
LOGP(DMGCP, LOGL_ERROR, "Wrong trunk name '%s'\n", mgcp);
return NULL;
}
endp = strtoul(rest + 1, &rest, 10);
if (rest == NULL || rest[0] != '@') {
- LOGP(DMGCP, LOGL_ERROR, "Wrong trunk name '%s'\n", mgcp);
+ LOGP(DMGCP, LOGL_ERROR, "Wrong endpoint name '%s'\n", mgcp);
return NULL;
}
@@ -287,7 +287,7 @@ static struct mgcp_endpoint *find_e1_endpoint(struct mgcp_config *cfg,
if (endp == 1)
return NULL;
- mgcp_endp = mgcp_timeslot_to_endpoint(trunk, endp);
+ mgcp_endp = mgcp_timeslot_to_endpoint(trunk - 1, endp);
if (mgcp_endp < 1 || mgcp_endp >= cfg->number_endpoints) {
LOGP(DMGCP, LOGL_ERROR, "Failed to find endpoint '%s'\n", mgcp);
}