9
0
Fork 0

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.
This commit is contained in:
Holger Hans Peter Freyther 2012-01-23 16:28:16 +01:00
parent c96c57b8d5
commit e1ec4c7047
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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);