--- app_voicemail.c.orig 2006-06-22 14:16:58.000000000 +0200 +++ app_voicemail.c 2006-06-23 09:53:37.000000000 +0200 @@ -392,6 +392,13 @@ static int skipms; static int maxlogins; +/* cutom password sounds */ +static char vm_password[260] = "vm-password"; +static char vm_newpassword[260] = "vm-newpassword"; +static char vm_passchanged[260] = "vm-passchanged"; +static char vm_reenterpassword[260] = "vm-reenterpassword"; +static char vm_mismatch[260] = "vm-mismatch"; + static struct ast_flags globalflags = {0}; static int saydurationminfo; @@ -4630,7 +4637,7 @@ so they won't get here again */ for (;;) { newpassword[1] = '\0'; - newpassword[0] = cmd = ast_play_and_wait(chan,"vm-newpassword"); + newpassword[0] = cmd = ast_play_and_wait(chan, vm_newpassword); if (cmd == '#') newpassword[0] = '\0'; if (cmd < 0 || cmd == 't' || cmd == '#') @@ -4639,7 +4646,7 @@ if (cmd < 0 || cmd == 't' || cmd == '#') return cmd; newpassword2[1] = '\0'; - newpassword2[0] = cmd = ast_play_and_wait(chan,"vm-reenterpassword"); + newpassword2[0] = cmd = ast_play_and_wait(chan, vm_reenterpassword); if (cmd == '#') newpassword2[0] = '\0'; if (cmd < 0 || cmd == 't' || cmd == '#') @@ -4650,7 +4657,7 @@ if (!strcmp(newpassword, newpassword2)) break; ast_log(LOG_NOTICE,"Password mismatch for user %s (%s != %s)\n", vms->username, newpassword, newpassword2); - cmd = ast_play_and_wait(chan, "vm-mismatch"); + cmd = ast_play_and_wait(chan, vm_mismatch); if (++tries == 3) return -1; } @@ -4659,7 +4666,7 @@ else vm_change_password_shell(vmu,newpassword); - cmd = ast_play_and_wait(chan,"vm-passchanged"); + cmd = ast_play_and_wait(chan, vm_passchanged); /* If forcename is set, have the user record their name */ if (ast_test_flag(vmu, VM_FORCENAME)) { @@ -4729,7 +4736,7 @@ break; } newpassword[1] = '\0'; - newpassword[0] = cmd = ast_play_and_wait(chan,"vm-newpassword"); + newpassword[0] = cmd = ast_play_and_wait(chan, vm_newpassword); if (cmd == '#') newpassword[0] = '\0'; else { @@ -4740,7 +4747,7 @@ } } newpassword2[1] = '\0'; - newpassword2[0] = cmd = ast_play_and_wait(chan,"vm-reenterpassword"); + newpassword2[0] = cmd = ast_play_and_wait(chan, vm_reenterpassword); if (cmd == '#') newpassword2[0] = '\0'; else { @@ -4753,7 +4760,7 @@ } if (strcmp(newpassword, newpassword2)) { ast_log(LOG_NOTICE,"Password mismatch for user %s (%s != %s)\n", vms->username, newpassword, newpassword2); - cmd = ast_play_and_wait(chan, "vm-mismatch"); + cmd = ast_play_and_wait(chan, vm_mismatch); break; } if (ast_strlen_zero(ext_pass_cmd)) @@ -4761,7 +4768,7 @@ else vm_change_password_shell(vmu,newpassword); ast_log(LOG_DEBUG,"User %s set password to %s of length %d\n",vms->username,newpassword,(int)strlen(newpassword)); - cmd = ast_play_and_wait(chan,"vm-passchanged"); + cmd = ast_play_and_wait(chan, vm_passchanged); break; case '*': cmd = 't'; @@ -5012,7 +5019,7 @@ /* saved password is blank, so don't bother asking */ password[0] = '\0'; } else { - if (ast_streamfile(chan, "vm-password", chan->language)) { + if (ast_streamfile(chan, vm_password, chan->language)) { ast_log(LOG_WARNING, "Unable to stream password file\n"); return -1; } @@ -5883,6 +5890,11 @@ char *exitcxt = NULL; char *extpc; char *emaildateformatstr; + char *vm_paswd; + char *vm_newpasswd; + char *vm_passchange; + char *vm_reenterpass; + char *vm_mism; int x; int tmpadsi[4]; @@ -6128,6 +6140,28 @@ } else { exitcontext[0] = '\0'; } + + /* load password sounds configuration */ + if ((vm_paswd = ast_variable_retrieve(cfg, "general", "vm-password"))) { + strcpy(vm_password, vm_paswd); + ast_log(LOG_DEBUG, "found pasword sound vm-password: %s\n", vm_password); + } + if ((vm_newpasswd = ast_variable_retrieve(cfg, "general", "vm-newpassword"))) { + strcpy(vm_newpassword, vm_newpasswd); + ast_log(LOG_DEBUG, "found pasword sound vm-newpassword: %s\n", vm_newpassword); + } + if ((vm_passchange = ast_variable_retrieve(cfg, "general", "vm-passchanged"))) { + strcpy(vm_passchanged, vm_passchange); + ast_log(LOG_DEBUG, "found pasword sound vm-passchanged: %s\n", vm_passchanged); + } + if ((vm_reenterpass = ast_variable_retrieve(cfg, "general", "vm-reenterpassword"))) { + strcpy(vm_reenterpassword, vm_reenterpass); + ast_log(LOG_DEBUG, "found pasword sound vm-reenterpassword: %s\n", vm_reenterpassword); + } + if ((vm_mism = ast_variable_retrieve(cfg, "general", "vm-mismatch"))) { + strcpy(vm_mismatch, vm_mism); + ast_log(LOG_DEBUG, "found pasword sound vm_mismatch: %s\n", vm_mismatch); + } if (!(astdirfwd = ast_variable_retrieve(cfg, "general", "usedirectory"))) astdirfwd = "no";