[Asterisk-cvs] asterisk/apps app_meetme.c,1.50,1.51

markster at lists.digium.com markster at lists.digium.com
Mon Jul 26 23:21:55 CDT 2004


Update of /usr/cvsroot/asterisk/apps
In directory localhost.localdomain:/tmp/cvs-serv8601/apps

Modified Files:
	app_meetme.c 
Log Message:
Merge tilghman's meetme fix for reentering pin (bug #2143)


Index: app_meetme.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_meetme.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- app_meetme.c	14 Jul 2004 07:22:30 -0000	1.50
+++ app_meetme.c	27 Jul 2004 03:08:00 -0000	1.51
@@ -1324,33 +1324,44 @@
 					confno[0] = '\0';
 			} else {
 				if (!ast_strlen_zero(cnf->pin)) {
-					char pin[AST_MAX_EXTENSION];
+					char pin[AST_MAX_EXTENSION]="";
+					int j;
 
-					if (*the_pin) {
-						strncpy(pin, the_pin, sizeof(pin) - 1);
-						res = 0;
-					} else {
-						/* Prompt user for pin if pin is required */
-						res = ast_app_getdata(chan, "conf-getpin", pin, sizeof(pin) - 1, 0);
-					}
-					if (res >= 0) {
-						if (!strcasecmp(pin, cnf->pin)) {
-							/* Pin correct */
-							allowretry = 0;
-							/* Run the conference */
-							res = conf_run(chan, cnf, confflags);
+					/* Allow the pin to be retried up to 3 times */
+					for (j=0; j<3; j++) {
+						if (*the_pin) {
+							strncpy(pin, the_pin, sizeof(pin) - 1);
+							res = 0;
+						} else {
+							/* Prompt user for pin if pin is required */
+							res = ast_app_getdata(chan, "conf-getpin", pin, sizeof(pin) - 1, 0);
+						}
+						if (res >= 0) {
+							if (!strcasecmp(pin, cnf->pin)) {
+								/* Pin correct */
+								allowretry = 0;
+								/* Run the conference */
+								res = conf_run(chan, cnf, confflags);
+								break;
+							} else {
+								/* Pin invalid */
+								res = ast_streamfile(chan, "conf-invalidpin", chan->language);
+								if (!res)
+									ast_waitstream(chan, "");
+								res = -1;
+								if (allowretry)
+									confno[0] = '\0';
+							}
 						} else {
-							/* Pin invalid */
-							res = ast_streamfile(chan, "conf-invalidpin", chan->language);
-							if (!res)
-								ast_waitstream(chan, "");
 							res = -1;
-							if (allowretry)
-								confno[0] = '\0';
+							allowretry = 0;
+							break;
+						}
+
+						/* Don't retry pin with a static pin */
+						if (*the_pin) {
+							break;
 						}
-					} else {
-						res = -1;
-						allowretry = 0;
 					}
 				} else {
 					/* No pin required */




More information about the svn-commits mailing list