aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authormogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-16 17:46:12 +0000
committermogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-16 17:46:12 +0000
commit7023711ede31d5cce3d512c5b91ccff59c72684e (patch)
treed6ff9c34231aa4938df5ddc5d5b34213bbe14a15 /apps/app_voicemail.c
parent02dfae58b1c2f915be1778627bef166f51d74ebc (diff)
minor things i missed before i get jumped on
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@51150 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r--apps/app_voicemail.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index fb41ab24f..af8ad5447 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -659,9 +659,9 @@ static void apply_options_full(struct ast_vm_user *retval, struct ast_variable *
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 @@ static void vm_change_password(struct ast_vm_user *vmu, const char *newpassword)
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 @@ static void vm_change_password(struct ast_vm_user *vmu, const char *newpassword)
/* 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);