[asterisk-commits] mogorman: branch 1.4 r51150 - /branches/1.4/apps/app_voicemail.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jan 16 10:46:13 MST 2007


Author: mogorman
Date: Tue Jan 16 11:46:12 2007
New Revision: 51150

URL: http://svn.digium.com/view/asterisk?view=rev&rev=51150
Log:
minor things i missed before i get jumped on

Modified:
    branches/1.4/apps/app_voicemail.c

Modified: branches/1.4/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_voicemail.c?view=diff&rev=51150&r1=51149&r2=51150
==============================================================================
--- branches/1.4/apps/app_voicemail.c (original)
+++ branches/1.4/apps/app_voicemail.c Tue Jan 16 11:46:12 2007
@@ -659,9 +659,9 @@
 	while (tmp) {
 		if (!strcasecmp(tmp->name, "password") || !strcasecmp(tmp->name, "secret")) {
 			ast_copy_string(retval->password, tmp->value, sizeof(retval->password));
-		} else if  (!strcasecmp(tmp->name, "secret")) {
+		} else if (!strcasecmp(tmp->name, "secret")) {
 			/* dont let secret override vmpassword */
-			if ((strlen(retval->password) == 0))
+			if (ast_strlen_zero(retval->password))
 				ast_copy_string(retval->password, tmp->value, sizeof(retval->password));	
 		} else if (!strcasecmp(tmp->name, "uniqueid")) {
 			ast_copy_string(retval->uniqueid, tmp->value, sizeof(retval->uniqueid));
@@ -781,7 +781,7 @@
 					ast_log(LOG_WARNING, "variable has bad format.\n");
 					break;
 				}
-				len  = (strlen(value) + strlen(newpassword));
+				len = (strlen(value) + strlen(newpassword));
 				
 				if (!(new = ast_calloc(1,len))) {
 					ast_log(LOG_WARNING, "Memory Allocation Failed.\n");
@@ -808,21 +808,26 @@
 	/* check users.conf and update the password stored for the mailbox*/
 	/* if no vmpassword entry exists create one. */
 	if ((cfg = ast_config_load_with_comments("users.conf"))) {
-		ast_log(LOG_WARNING, "we are looking for %s\n", vmu->mailbox);
+		if (option_debug > 3)
+			ast_log(LOG_DEBUG, "we are looking for %s\n", vmu->mailbox);
 		while ((category = ast_category_browse(cfg, category))) {
-			ast_log(LOG_WARNING, "users.conf: %s\n", category);
+			if (option_debug > 3)
+				ast_log(LOG_DEBUG, "users.conf: %s\n", category);
 			if (!strcasecmp(category, vmu->mailbox)) {
 				if (!(tmp = ast_variable_retrieve(cfg, category, "vmpassword"))) {
-					ast_log(LOG_WARNING, "looks like we need to make vmpassword!\n");
+					if (option_debug > 3)
+						ast_log(LOG_DEBUG, "looks like we need to make vmpassword!\n");
 					var = ast_variable_new("vmpassword", newpassword);
 				} 
 				if (!(new = ast_calloc(1,strlen(newpassword)))) {
-					ast_log(LOG_WARNING, "Memory Allocation Failed.\n");
+					if (option_debug > 3)
+						ast_log(LOG_DEBUG, "Memory Allocation Failed.\n");
 					break;
 				} 
 				sprintf(new, "%s", newpassword);
 				if (!(cat = ast_category_get(cfg, category))) {
-					ast_log(LOG_WARNING, "failed to get category!\n");
+					if (option_debug > 3)
+						ast_log(LOG_DEBUG, "failed to get category!\n");
 				}
 				if (!var)		
 					ast_variable_update(cat, "vmpassword", new, NULL);



More information about the asterisk-commits mailing list