[Asterisk-cvs] asterisk/apps app_voicemail.c,1.144,1.145

markster at lists.digium.com markster at lists.digium.com
Sun Sep 5 15:35:26 CDT 2004


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv13482/apps

Modified Files:
	app_voicemail.c 
Log Message:
Don't prompt for password if one is not needed (bug #2385)


Index: app_voicemail.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -d -r1.144 -r1.145
--- app_voicemail.c	5 Sep 2004 18:31:50 -0000	1.144
+++ app_voicemail.c	5 Sep 2004 19:38:17 -0000	1.145
@@ -3617,13 +3617,20 @@
 		}
 		if (useadsi)
 			adsi_password(chan);
-		if (ast_streamfile(chan, "vm-password", chan->language)) {
-			ast_log(LOG_WARNING, "Unable to stream password file\n");
-			goto out;
-		}
-		if (ast_readstring(chan, password, sizeof(password) - 1, 2000, 10000, "#") < 0) {
-			ast_log(LOG_WARNING, "Unable to read password\n");
-			goto out;
+		if (!skipuser)
+			vmu = find_user(&vmus, context, vms.username);
+		if (vmu && vmu->password[0] == '\0') {
+			/* saved password is blank, so don't bother asking */
+			password[0] = '\0';
+		} else {
+			if (ast_streamfile(chan, "vm-password", chan->language)) {
+				ast_log(LOG_WARNING, "Unable to stream password file\n");
+				goto out;
+			}
+			if (ast_readstring(chan, password, sizeof(password) - 1, 2000, 10000, "#") < 0) {
+				ast_log(LOG_WARNING, "Unable to read password\n");
+				goto out;
+			}
 		}
 		if (prefix) {
 			char fullusername[80] = "";
@@ -3631,8 +3638,6 @@
 			strncat(fullusername, vms.username, sizeof(fullusername) - 1);
 			strncpy(vms.username, fullusername, sizeof(vms.username) - 1);
 		}
-		if (!skipuser) 
-			vmu = find_user(&vmus, context, vms.username);
 		if (vmu && !strcmp(vmu->password, password)) 
 			valid++;
 		else {




More information about the svn-commits mailing list