aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-01-23 16:28:16 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-01-23 16:28:16 +0100
commitec55342ed88300673515bf97b86191f11e9ce581 (patch)
tree21ef02ba7b8e0d482b7de350a8478999abe575ed
parent9b9a0bd26826e86ba4a83b1e23bf49f66c598325 (diff)
hw: The DSP resource was one based with the SNMP API, subtract it
* Change the assigning dsp_resource to start with one and increase after usage and not before usage (so it becomes the next free port). * Subtract one from dsp_port after we have selected the path. In the longer run I should make dsp_resources zero based all the way.
-rw-r--r--src/mgcp_hw.c4
-rw-r--r--src/mgcp_ss7.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mgcp_hw.c b/src/mgcp_hw.c
index bcda02e..1fd4d92 100644
--- a/src/mgcp_hw.c
+++ b/src/mgcp_hw.c
@@ -75,11 +75,11 @@ int mgcp_hw_connect(int port, int trunk, int timeslot)
_tx_port = tx_port_get(port);
status = PTI_ConnectHSCM(PTI_HSCM_TRUNK + trunk, timeslot - 1,
- PTI_HSCM_PTMC, _rx_port, 1, 0);
+ PTI_HSCM_PTMC, _rx_port - 1, 1, 0);
if (status != 0)
return -1;
- status = PTI_ConnectHSCM(PTI_HSCM_PTMC, _tx_port,
+ status = PTI_ConnectHSCM(PTI_HSCM_PTMC, _tx_port - 1,
PTI_HSCM_TRUNK + trunk, timeslot - 1, 1, 0);
if (status != 0)
return -1;
diff --git a/src/mgcp_ss7.c b/src/mgcp_ss7.c
index 97c2951..24a494f 100644
--- a/src/mgcp_ss7.c
+++ b/src/mgcp_ss7.c
@@ -704,8 +704,8 @@ static int configure_trunk(struct mgcp_trunk_config *tcfg, int *dsp_resource)
if (tcfg->endpoints[i].blocked)
continue;
- *dsp_resource += 1;
tcfg->endpoints[i].hw_dsp_port = *dsp_resource;
+ *dsp_resource += 1;
if (tcfg->cfg->configure_trunks) {
int multiplex, timeslot, res;
@@ -764,7 +764,7 @@ static struct mgcp_ss7 *mgcp_ss7_init(struct mgcp_config *cfg)
}
/* Now do the init of the trunks */
- dsp_resource = 0;
+ dsp_resource = 1;
llist_for_each_entry(trunk, &cfg->vtrunks, entry) {
if (configure_trunk(trunk, &dsp_resource) != 0) {
talloc_free(conf);