summaryrefslogtreecommitdiff
path: root/dahdi_cfg.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2009-03-26 18:02:31 +0000
committerKevin P. Fleming <kpfleming@digium.com>2009-03-26 18:02:31 +0000
commit0db1114c4dbff1b553e903b483f14428bf670dee (patch)
tree1809de98fee309530f1a19146ada374b2511997f /dahdi_cfg.c
parent611e82f79cbf92ee22a4d6803e1eac45eb4469f3 (diff)
when /etc/dahdi/system.conf does not have an echo canceller defined for a channel, but the channel previously had one assigned, running dahdi_cfg does not remove the assigned echo canceller from the channel as it should. this commit changes that behavior, so that every channel with a defined signaling mode is updated to have the proper (or no) echo canceller assigned.
git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@6259 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'dahdi_cfg.c')
-rw-r--r--dahdi_cfg.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/dahdi_cfg.c b/dahdi_cfg.c
index 27d39ad..8f0dd0a 100644
--- a/dahdi_cfg.c
+++ b/dahdi_cfg.c
@@ -723,8 +723,7 @@ static int setechocan(char *keyword, char *args)
for (x = 0; x < DAHDI_MAX_CHANNELS; x++) {
if (chans[x]) {
- ae[x].chan = x;
- dahdi_copy_string(ae[x].echocan, echocan, sizeof(ae[0].echocan));
+ dahdi_copy_string(ae[x].echocan, echocan, sizeof(ae[x].echocan));
}
}
@@ -1304,9 +1303,7 @@ static void printconfig(int fd)
printf("Channel %02d %s to %02d", x, sig[x], cc[x].idlebits);
else {
printf("Channel %02d: %s (%s)", x, sig[x], laws[cc[x].deflaw]);
- if (ae[x].echocan[0]) {
- printf(" (Echo Canceler: %s)", ae[x].echocan);
- }
+ printf(" (Echo Canceler: %s)", ae[x].echocan[0] ? ae[x].echocan : "none");
for (y=1;y<DAHDI_MAX_CHANNELS;y++) {
if (cc[y].master == x) {
printf("%s%02d", ps++ ? " " : " (Slaves: ", y);
@@ -1620,16 +1617,15 @@ finish:
exit(1);
}
- if (ae[x].chan) {
- if (verbose) {
- printf("Setting echocan for channel %d to %s\n",
- ae[x].chan, ae[x].echocan);
- }
- if (ioctl(fd, DAHDI_ATTACH_ECHOCAN, &ae[x])) {
- fprintf(stderr, "DAHDI_ATTACH_ECHOCAN failed on channel %d: %s (%d)\n", x, strerror(errno), errno);
- close(fd);
- exit(1);
- }
+ ae[x].chan = x;
+ if (verbose) {
+ printf("Setting echocan for channel %d to %s\n", ae[x].chan, ae[x].echocan[0] ? ae[x].echocan : "none");
+ }
+
+ if (ioctl(fd, DAHDI_ATTACH_ECHOCAN, &ae[x])) {
+ fprintf(stderr, "DAHDI_ATTACH_ECHOCAN failed on channel %d: %s (%d)\n", x, strerror(errno), errno);
+ close(fd);
+ exit(1);
}
}
for (x=0;x<numzones;x++) {