From b7299a89cdf2b10906a116a33f537f0694927931 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 1 Mar 2011 15:48:05 +0100 Subject: mgcp: Configure the HSCOMM routing based on the information we have Configure the routing of audio ports if mgcp_mgw is configured to do this. This allows to have multiple trunks, make virtual ports go to a specific trunk as well. --- src/mgcp_ss7.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/mgcp_ss7.c') diff --git a/src/mgcp_ss7.c b/src/mgcp_ss7.c index 2061943..f7b2ff4 100644 --- a/src/mgcp_ss7.c +++ b/src/mgcp_ss7.c @@ -687,6 +687,12 @@ static struct mgcp_ss7 *mgcp_ss7_init(struct mgcp_config *cfg) return NULL; } + if (cfg->configure_trunks && mgcp_snmp_init() != 0) { + LOGP(DMGCP, LOGL_ERROR, "Failed to initialize SNMP.\n"); + talloc_free(conf); + return NULL; + } + /* Now do the init of the trunks */ dsp_resource = 0; for (i = 1; i < cfg->trunk.number_endpoints; ++i) { @@ -696,6 +702,20 @@ static struct mgcp_ss7 *mgcp_ss7_init(struct mgcp_config *cfg) continue; dsp_resource += 1; + + if (cfg->configure_trunks) { + int res; + + res = mgcp_snmp_connect(dsp_resource, + cfg->trunk.target_trunk_start + multiplex, + timeslot); + + if (res != 0) { + LOGP(DMGCP, LOGL_ERROR, "Failed to configure virtual trunk.\n"); + talloc_free(conf); + return NULL; + } + } } llist_for_each_entry(trunk, &cfg->trunks, entry) { @@ -708,6 +728,21 @@ static struct mgcp_ss7 *mgcp_ss7_init(struct mgcp_config *cfg) continue; dsp_resource += 1; + + if (cfg->configure_trunks) { + int res; + + res = mgcp_snmp_connect(dsp_resource, + trunk->trunk_nr + multiplex, + timeslot); + + if (res != 0) { + LOGP(DMGCP, LOGL_ERROR, + "Failed to configure virtual trunk.\n"); + talloc_free(conf); + return NULL; + } + } } } -- cgit v1.2.3