[asterisk-commits] anthonyl: branch anthonyl/usersconf-vmpassword
r50462 - /team/anthonyl/usersc...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Wed Jan 10 15:09:35 MST 2007
Author: anthonyl
Date: Wed Jan 10 16:09:35 2007
New Revision: 50462
URL: http://svn.digium.com/view/asterisk?view=rev&rev=50462
Log:
some spacing update and append vmpassword if it needs to exist in users.conf
Modified:
team/anthonyl/usersconf-vmpassword/apps/app_voicemail.c
Modified: team/anthonyl/usersconf-vmpassword/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/usersconf-vmpassword/apps/app_voicemail.c?view=diff&rev=50462&r1=50461&r2=50462
==============================================================================
--- team/anthonyl/usersconf-vmpassword/apps/app_voicemail.c (original)
+++ team/anthonyl/usersconf-vmpassword/apps/app_voicemail.c Wed Jan 10 16:09:35 2007
@@ -826,6 +826,7 @@
free(new);
}
category = NULL;
+ var = NULL;
/* check users.conf and update the password stored for the mailbox*/
/* if no vmpassword entry exists create one. */
if ((cfg = ast_config_load("users.conf"))) {
@@ -834,9 +835,9 @@
ast_log(LOG_WARNING, "users.conf: %s\n", category);
if (!strcasecmp(category, vmu->mailbox)) {
if (!(tmp = ast_variable_retrieve(cfg, category, "vmpassword"))) {
- ast_log(LOG_WARNING, "we need to make vmpassword!\n");
+ ast_log(LOG_WARNING, "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");
break;
@@ -845,7 +846,10 @@
if (!(cat = ast_category_get(cfg, category))) {
ast_log(LOG_WARNING, "failed to get category!\n");
}
- ast_variable_update(cat, "vmpassword", new, NULL);
+ if (!var)
+ ast_variable_update(cat, "vmpassword", new, NULL);
+ else
+ ast_variable_append(vat, var);
}
}
/* save the results and clean things up */
@@ -855,11 +859,7 @@
if (new)
free(new);
}
-
-
- /* this is strange but i don't see change_password_realtime being called anywhere in vm_new or vm_options*/
change_password_realtime(vmu, newpassword);
-
return;
}
More information about the asterisk-commits
mailing list