[asterisk-commits] anthonyl: branch anthonyl/usersconf-vmpassword
r50293 - /team/anthonyl/usersc...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Jan 9 21:09:16 MST 2007
Author: anthonyl
Date: Tue Jan 9 22:09:16 2007
New Revision: 50293
URL: http://svn.digium.com/view/asterisk?view=rev&rev=50293
Log:
added the support for vmpassword in users.conf, added support for using secret as the voicemail password rather then password (qwell made this change eariler in the day but not in this branch), also vmpassword overrides secret. if both exist, but secret is use if vmpassword is not defined.
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=50293&r1=50292&r2=50293
==============================================================================
--- team/anthonyl/usersconf-vmpassword/apps/app_voicemail.c (original)
+++ team/anthonyl/usersconf-vmpassword/apps/app_voicemail.c Tue Jan 9 22:09:16 2007
@@ -679,8 +679,12 @@
tmp = var;
while (tmp) {
ast_log(LOG_DEBUG, "Name: %s Value: %s\n", tmp->name, tmp->value);
- if (!strcasecmp(tmp->name, "password")) {
+ if (!strcasecmp(tmp->name, "vmpassword")) {
ast_copy_string(retval->password, tmp->value, sizeof(retval->password));
+ } else if (!strcasecmp(tmp->name, "secret")) {
+ /* dont let secret override vmpassword */
+ if ((strlen(retval->password) == 0))
+ 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));
} else if (!strcasecmp(tmp->name, "pager")) {
@@ -824,16 +828,17 @@
/* if no vmpassword entry exists create one. */
if ((cfg = ast_config_load("users.conf"))) {
while ((category = ast_category_browse(cfg, category))) {
+ ast_log(LOG_WARNING, "users.conf: %s\n", category);
for (var = ast_variable_browse(cfg, category); var; var = var->next) {
/* check the context */
/* write the password to memory */
/* reset_user_pw(vmu->context, vmu->mailbox, newpassword); */
+ ast_log(LOG_WARNING,"\tname: %s %s\n", var->name, var->value);
}
}
/* save the results */
config_text_file_save("users.conf", cfg, "AppVoicemail");
}
-
return;
}
More information about the asterisk-commits
mailing list