[asterisk-commits] kmoore: branch 10 r344440 - in /branches/10: ./ apps/app_meetme.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Nov 10 15:14:56 CST 2011
Author: kmoore
Date: Thu Nov 10 15:14:52 2011
New Revision: 344440
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=344440
Log:
Fix another incorrect case with meetme's PIN logic and add documentation
This fixes an issue where a user of a dynamic conference was asked for a PIN
twice. This also adds documentation to assist in future modifications to the
piece of code responsible for PIN checking.
(closes issue AST-670)
........
Merged revisions 344439 from http://svn.asterisk.org/svn/asterisk/branches/1.8
Modified:
branches/10/ (props changed)
branches/10/apps/app_meetme.c
Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.
Modified: branches/10/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/apps/app_meetme.c?view=diff&rev=344440&r1=344439&r2=344440
==============================================================================
--- branches/10/apps/app_meetme.c (original)
+++ branches/10/apps/app_meetme.c Thu Nov 10 15:14:52 2011
@@ -4429,14 +4429,27 @@
res = -1;
}
} else {
- /* Check to see if the conference requires pin
- * validation and check for exemptions to that
- * requirement. */
- if ((!ast_strlen_zero(cnf->pin) ||
+ /* Conference requires a pin for specified access level */
+ int req_pin = !ast_strlen_zero(cnf->pin) ||
(!ast_strlen_zero(cnf->pinadmin) &&
- ast_test_flag64(&confflags, CONFFLAG_ADMIN))) &&
- (ast_test_flag64(&confflags, CONFFLAG_ALWAYSPROMPT) ||
- ast_strlen_zero(args.pin) || !cnf->isdynamic)) {
+ ast_test_flag64(&confflags, CONFFLAG_ADMIN));
+ /* The following logic was derived from a
+ * 4 variable truth table and defines which
+ * circumstances are not exempt from pin
+ * checking.
+ * If this needs to be modified, write the
+ * truth table back out from the boolean
+ * expression AB+A'D+C', change the erroneous
+ * result, and rederive the expression.
+ * Variables:
+ * A: pin provided?
+ * B: always prompt?
+ * C: dynamic?
+ * D: has users? */
+ int not_exempt = !cnf->isdynamic;
+ not_exempt = not_exempt || (!ast_strlen_zero(args.pin) && ast_test_flag64(&confflags, CONFFLAG_ALWAYSPROMPT));
+ not_exempt = not_exempt || (ast_strlen_zero(args.pin) && cnf->users);
+ if (req_pin && not_exempt) {
char pin[MAX_PIN] = "";
int j;
More information about the asterisk-commits
mailing list