[asterisk-commits] mogorman: trunk r51151 - in /trunk: ./ apps/app_voicemail.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jan 16 10:47:27 MST 2007


Author: mogorman
Date: Tue Jan 16 11:47:26 2007
New Revision: 51151

URL: http://svn.digium.com/view/asterisk?view=rev&rev=51151
Log:
Merged revisions 51150 via svnmerge from 
https://svn.digium.com/svn/asterisk/branches/1.4

........
r51150 | mogorman | 2007-01-16 11:46:12 -0600 (Tue, 16 Jan 2007) | 2 lines

minor things i missed before i get jumped on

........

Modified:
    trunk/   (props changed)
    trunk/apps/app_voicemail.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=51151&r1=51150&r2=51151
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Tue Jan 16 11:47:26 2007
@@ -681,9 +681,9 @@
 		ast_log(LOG_DEBUG, "Name: %s Value: %s\n", tmp->name, tmp->value);
 		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));
@@ -803,7 +803,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");
@@ -830,21 +830,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