aboutsummaryrefslogtreecommitdiffstats
path: root/src/mgcp_ss7.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-03-01 15:48:05 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-03-01 16:07:54 +0100
commitb7299a89cdf2b10906a116a33f537f0694927931 (patch)
treeec2a0612a6775c69c285ba4c09bbea1433b214db /src/mgcp_ss7.c
parentd384912f76a04beed8a2f63ec24b72506b13f833 (diff)
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.
Diffstat (limited to 'src/mgcp_ss7.c')
-rw-r--r--src/mgcp_ss7.c35
1 files changed, 35 insertions, 0 deletions
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;
+ }
+ }
}
}