mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-01 12:33:49 +00:00
mgcp: We want to count trunks starting from one.
This commit is contained in:
@@ -272,14 +272,14 @@ static struct mgcp_endpoint *find_e1_endpoint(struct mgcp_config *cfg,
|
|||||||
int trunk, endp, mgcp_endp;
|
int trunk, endp, mgcp_endp;
|
||||||
|
|
||||||
trunk = strtoul(mgcp + 6, &rest, 10);
|
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);
|
LOGP(DMGCP, LOGL_ERROR, "Wrong trunk name '%s'\n", mgcp);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
endp = strtoul(rest + 1, &rest, 10);
|
endp = strtoul(rest + 1, &rest, 10);
|
||||||
if (rest == NULL || rest[0] != '@') {
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,7 +287,7 @@ static struct mgcp_endpoint *find_e1_endpoint(struct mgcp_config *cfg,
|
|||||||
if (endp == 1)
|
if (endp == 1)
|
||||||
return NULL;
|
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) {
|
if (mgcp_endp < 1 || mgcp_endp >= cfg->number_endpoints) {
|
||||||
LOGP(DMGCP, LOGL_ERROR, "Failed to find endpoint '%s'\n", mgcp);
|
LOGP(DMGCP, LOGL_ERROR, "Failed to find endpoint '%s'\n", mgcp);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ static struct msgb *create_auep1()
|
|||||||
struct msgb *msg;
|
struct msgb *msg;
|
||||||
|
|
||||||
msg = msgb_alloc_headroom(4096, 128, "MGCP msg");
|
msg = msgb_alloc_headroom(4096, 128, "MGCP msg");
|
||||||
int len = sprintf((char *)msg->data, "AUEP 158663169 ds/e1-0/2@172.16.6.66 MGCP 1.0\r\n");
|
int len = sprintf((char *)msg->data, "AUEP 158663169 ds/e1-1/2@172.16.6.66 MGCP 1.0\r\n");
|
||||||
msg->l2h = msgb_put(msg, len);
|
msg->l2h = msgb_put(msg, len);
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ static struct msgb *create_auep2()
|
|||||||
struct msgb *msg;
|
struct msgb *msg;
|
||||||
|
|
||||||
msg = msgb_alloc_headroom(4096, 128, "MGCP msg");
|
msg = msgb_alloc_headroom(4096, 128, "MGCP msg");
|
||||||
int len = sprintf((char *)msg->data, "AUEP 18983213 ds/e1-1/1@172.16.6.66 MGCP 1.0\r\n");
|
int len = sprintf((char *)msg->data, "AUEP 18983213 ds/e1-2/1@172.16.6.66 MGCP 1.0\r\n");
|
||||||
msg->l2h = msgb_put(msg, len);
|
msg->l2h = msgb_put(msg, len);
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user