aboutsummaryrefslogtreecommitdiffstats
path: root/src/mgcp_ss7_vty.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-09-13 22:41:48 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-09-13 22:53:13 +0200
commite72139a6f3713869637d15dfd9858a500fbf0425 (patch)
treeb3d24a0a796a642e1237b406ccb7ed5eb1181e93 /src/mgcp_ss7_vty.c
parentfc98ce252e7111c06e8051e0121b31913db9ff39 (diff)
mgcp: Remove the endp_offset that was introduced due coding stupidity
The endpoint offset is needed for two reasons, first the API is 0 based here while we are normally 1 based, second because of the trunks the first usable endpoint would be '2' (0 is CRC, 1 is signalling), but this endpoint offset falls apart when we would block timeslots inside this range. Remove the endpoint offset, in each endpoint we will store the HW DSP Port (1 based API) and then subtract one to get to the 0 based API for the Simple API. Print a warning when someone is using the endpoint offset.
Diffstat (limited to 'src/mgcp_ss7_vty.c')
-rw-r--r--src/mgcp_ss7_vty.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/mgcp_ss7_vty.c b/src/mgcp_ss7_vty.c
index 2eb4396..d145777 100644
--- a/src/mgcp_ss7_vty.c
+++ b/src/mgcp_ss7_vty.c
@@ -156,12 +156,12 @@ DEFUN(cfg_mgcp_dwnstr_target, cfg_mgcp_dwnstr_target_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_mgcp_endp_offset, cfg_mgcp_endp_offset_cmd,
+DEFUN_DEPRECATED(cfg_mgcp_endp_offset, cfg_mgcp_endp_offset_cmd,
"endpoint-offset <-60-60>",
"Offset to the CIC map\n" "Value to set\n")
{
- g_cfg->trunk.endp_offset = atoi(argv[0]);
- return CMD_SUCCESS;
+ vty_out(vty, "%%endpoint-offset is not used anymore.%s", VTY_NEWLINE);
+ return CMD_WARNING;
}
DEFUN(cfg_mgcp_target_trunk, cfg_mgcp_target_trunk_cmd,
@@ -307,14 +307,12 @@ DEFUN(cfg_trunk_dwnstr_target, cfg_trunk_dwnstr_target_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_trunk_endp_offset, cfg_trunk_endp_offset_cmd,
+DEFUN_DEPRECATED(cfg_trunk_endp_offset, cfg_trunk_endp_offset_cmd,
"endpoint-offset <-60-60>",
"Offset to the CIC map\n" "Value to set\n")
{
- struct mgcp_trunk_config *trunk = vty->index;
-
- trunk->endp_offset = atoi(argv[0]);
- return CMD_SUCCESS;
+ vty_out(vty, "%%endpoint-offset is not used anymore.%s", VTY_NEWLINE);
+ return CMD_WARNING;
}
void mgcp_write_extra(struct vty *vty, struct mgcp_config *cfg)
@@ -345,8 +343,6 @@ void mgcp_write_extra(struct vty *vty, struct mgcp_config *cfg)
cfg->trunk.dwnstr_max_gain, VTY_NEWLINE);
vty_out(vty, " downstream-target-level %d%s",
cfg->trunk.dwnstr_target_lvl, VTY_NEWLINE);
- vty_out(vty, " endpoint-offset %d%s",
- cfg->trunk.endp_offset, VTY_NEWLINE);
vty_out(vty, " target-trunk-start %d%s",
cfg->trunk.target_trunk_start, VTY_NEWLINE);
}
@@ -377,8 +373,6 @@ void mgcp_write_trunk_extra(struct vty *vty, struct mgcp_trunk_config *trunk)
trunk->dwnstr_max_gain, VTY_NEWLINE);
vty_out(vty, " downstream-target-level %d%s",
trunk->dwnstr_target_lvl, VTY_NEWLINE);
- vty_out(vty, " endpoint-offset %d%s",
- trunk->endp_offset, VTY_NEWLINE);
}