[svn-commits] kpfleming: tools/trunk r6259 - /tools/trunk/dahdi_cfg.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Mar 26 13:02:33 CDT 2009


Author: kpfleming
Date: Thu Mar 26 13:02:31 2009
New Revision: 6259

URL: http://svn.digium.com/svn-view/dahdi?view=rev&rev=6259
Log:
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.


Modified:
    tools/trunk/dahdi_cfg.c

Modified: tools/trunk/dahdi_cfg.c
URL: http://svn.digium.com/svn-view/dahdi/tools/trunk/dahdi_cfg.c?view=diff&rev=6259&r1=6258&r2=6259
==============================================================================
--- tools/trunk/dahdi_cfg.c (original)
+++ tools/trunk/dahdi_cfg.c Thu Mar 26 13:02:31 2009
@@ -723,8 +723,7 @@
 
 	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 @@
 					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 @@
 			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++) {




More information about the svn-commits mailing list