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:30:16 +0100
commite1ec4c7047e7c152f31a7ba13a3db5dd5c0df682 (patch)
treeee4ba7b44999c1b0caa5b8017ab89b8bff172820
parentc96c57b8d587e466fe63026fc210bf7ca6a5e7cf (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 345ea68..1b88e57 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);