diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-02-28 17:27:14 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-02-28 17:27:14 +0100 |
commit | f3da99ed6587e89aaff39b8cd504750aeb8e4a96 (patch) | |
tree | ad4ba727a3f2adeac8def86bbf84a5bf32a695da /src/mgcp_ss7.c | |
parent | 796406beee14ddfc839639edc5395627f1ad04be (diff) |
mgcp: Attempt to get the endpoint configuration right
number_endpoints is always one bigger than it needs to be,
subtract the one in the show command, start counting at one.
Diffstat (limited to 'src/mgcp_ss7.c')
-rw-r--r-- | src/mgcp_ss7.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mgcp_ss7.c b/src/mgcp_ss7.c index 9feb2e5..b7429c0 100644 --- a/src/mgcp_ss7.c +++ b/src/mgcp_ss7.c @@ -668,7 +668,7 @@ static struct mgcp_ss7 *mgcp_ss7_init(struct mgcp_config *cfg) if (mgcp_endpoints_allocate(conf->cfg) != 0) { LOGP(DMGCP, LOGL_ERROR, "Failed to allocate endpoints: %d\n", - cfg->number_endpoints); + cfg->number_endpoints - 1); talloc_free(conf); return NULL; } @@ -687,7 +687,7 @@ static struct mgcp_ss7 *mgcp_ss7_init(struct mgcp_config *cfg) return NULL; } - for (i = 0; i < conf->cfg->number_endpoints; ++i) { + for (i = 1; i < conf->cfg->number_endpoints; ++i) { struct mgcp_endpoint *endp; int rtp_port; @@ -742,7 +742,7 @@ void mgcp_ss7_reset(struct mgcp_ss7 *mgcp) LOGP(DMGCP, LOGL_INFO, "Resetting all endpoints.\n"); /* free UniPorted and MGCP data */ - for (i = 0; i < mgcp->cfg->number_endpoints; ++i) { + for (i = 1; i < mgcp->cfg->number_endpoints; ++i) { mgcp_ss7_endp_free(mgcp, i); mgcp_free_endp(&mgcp->cfg->endpoints[i]); } @@ -839,7 +839,7 @@ int main(int argc, char **argv) return rc; printf("Creating MGCP MGW with endpoints: %d ip: %s mgw: %s rtp-base: %d payload: %d\n", - g_cfg->number_endpoints, g_cfg->local_ip, g_cfg->bts_ip, + g_cfg->number_endpoints - 1, g_cfg->local_ip, g_cfg->bts_ip, g_cfg->rtp_base_port, g_cfg->audio_payload); mgcp = mgcp_ss7_init(g_cfg); |