Review Board 1.7.16


0019287: inverse / incorrect behavior for CLI / console logging of DTMF

Review Request #1244 - Created June 1, 2011 and submitted

Jonathan Rose
1.8
19287
Reviewers
asterisk-dev
dvossel, russell
Asterisk
ast_network_puts_mutable writes to a connected console client only if it's level was set to false.  This changes that function to write it only if it is set to true to resolve the reverse behavior from expectations issue.

This seems like the way to go, but I can't see for the life of me why this mistake would be made if it really was just a mistake.  It's hard to say.
Just tested with a couple of connected clients.  I'll test more tomorrow.

Changes between revision 3 and 4

1 2 3 4
1 2 3 4

  1. /branches/1.8/main/asterisk.c: Loading...
/branches/1.8/main/asterisk.c
Diff Revision 3 Diff Revision 4
[20] 1091 lines
[+20] [+] void ast_console_toggle_loglevel(int fd, int level, int state)
1092
		if (fd == consoles[x].fd) {
1092
		if (fd == consoles[x].fd) {
1093
			/*
1093
			/*
1094
			 * Since the logging occurs when levels are false, set to
1094
			 * Since the logging occurs when levels are false, set to
1095
			 * flipped iinput because this function accepts 0 as off and 1 as on
1095
			 * flipped iinput because this function accepts 0 as off and 1 as on
1096
			 */
1096
			 */
1097
			consoles[x].levels[level] = (state + 1) % 2;
1097
			consoles[x].levels[level] = state ? 0 : 1;
1098
			return;
1098
			return;
1099
		}
1099
		}
1100
	}
1100
	}
1101
}
1101
}
1102

    
   
1102

   
[+20] [20] 2792 lines
  1. /branches/1.8/main/asterisk.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.