Add the ability to customize some of the prompts used within the voicemail

application by configuring them in voicemail.conf (issue #7415, patch by
fkasumovic, with some fixes and documentation updates by myself)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Russell Bryant 19 years ago
parent de808a721a
commit 4a523b1b2d

@ -1,7 +1,9 @@
Changes since Asterisk 1.4-beta was branched: Changes since Asterisk 1.4-beta was branched:
* rev.45982: enable https support for builtin web server. * Added the ability to customize which sound files are used for some of the
prompts within the Voicemail application by changing them in voicemail.conf
* enable https support for builtin web server.
See configs/http.conf.sample for details. See configs/http.conf.sample for details.
* rev.45945: add a new option, match_auth_username, to sip.conf, * add a new option, match_auth_username, to sip.conf,
to improve the matching of incoming requests. to improve the matching of incoming requests.
If set, and the incoming request carries authentication info, If set, and the incoming request carries authentication info,
the username to match in the users list is taken from there the username to match in the users list is taken from there

@ -506,6 +506,13 @@ static int maxgreet;
static int skipms; static int skipms;
static int maxlogins; static int maxlogins;
/* cutom password sounds */
static char vm_password[80] = "vm-password";
static char vm_newpassword[80] = "vm-newpassword";
static char vm_passchanged[80] = "vm-passchanged";
static char vm_reenterpassword[80] = "vm-reenterpassword";
static char vm_mismatch[80] = "vm-mismatch";
static struct ast_flags globalflags = {0}; static struct ast_flags globalflags = {0};
static int saydurationminfo; static int saydurationminfo;
@ -5471,7 +5478,7 @@ static int vm_newuser(struct ast_channel *chan, struct ast_vm_user *vmu, struct
so they won't get here again */ so they won't get here again */
for (;;) { for (;;) {
newpassword[1] = '\0'; 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 == '#') if (cmd == '#')
newpassword[0] = '\0'; newpassword[0] = '\0';
if (cmd < 0 || cmd == 't' || cmd == '#') if (cmd < 0 || cmd == 't' || cmd == '#')
@ -5480,7 +5487,7 @@ static int vm_newuser(struct ast_channel *chan, struct ast_vm_user *vmu, struct
if (cmd < 0 || cmd == 't' || cmd == '#') if (cmd < 0 || cmd == 't' || cmd == '#')
return cmd; return cmd;
newpassword2[1] = '\0'; 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 == '#') if (cmd == '#')
newpassword2[0] = '\0'; newpassword2[0] = '\0';
if (cmd < 0 || cmd == 't' || cmd == '#') if (cmd < 0 || cmd == 't' || cmd == '#')
@ -5491,7 +5498,7 @@ static int vm_newuser(struct ast_channel *chan, struct ast_vm_user *vmu, struct
if (!strcmp(newpassword, newpassword2)) if (!strcmp(newpassword, newpassword2))
break; break;
ast_log(LOG_NOTICE,"Password mismatch for user %s (%s != %s)\n", vms->username, 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);
if (++tries == 3) if (++tries == 3)
return -1; return -1;
} }
@ -5501,7 +5508,7 @@ static int vm_newuser(struct ast_channel *chan, struct ast_vm_user *vmu, struct
vm_change_password_shell(vmu,newpassword); vm_change_password_shell(vmu,newpassword);
if (option_debug) if (option_debug)
ast_log(LOG_DEBUG,"User %s set password to %s of length %d\n",vms->username,newpassword,(int)strlen(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);
/* If forcename is set, have the user record their name */ /* If forcename is set, have the user record their name */
if (ast_test_flag(vmu, VM_FORCENAME)) { if (ast_test_flag(vmu, VM_FORCENAME)) {
@ -5571,7 +5578,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
break; break;
} }
newpassword[1] = '\0'; 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 == '#') if (cmd == '#')
newpassword[0] = '\0'; newpassword[0] = '\0';
else { else {
@ -5582,7 +5589,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
} }
} }
newpassword2[1] = '\0'; 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 == '#') if (cmd == '#')
newpassword2[0] = '\0'; newpassword2[0] = '\0';
else { else {
@ -5595,7 +5602,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
} }
if (strcmp(newpassword, newpassword2)) { if (strcmp(newpassword, newpassword2)) {
ast_log(LOG_NOTICE,"Password mismatch for user %s (%s != %s)\n", vms->username, 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; break;
} }
if (ast_strlen_zero(ext_pass_cmd)) if (ast_strlen_zero(ext_pass_cmd))
@ -5604,7 +5611,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
vm_change_password_shell(vmu,newpassword); vm_change_password_shell(vmu,newpassword);
if (option_debug) if (option_debug)
ast_log(LOG_DEBUG,"User %s set password to %s of length %d\n",vms->username,newpassword,(int)strlen(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; break;
case '*': case '*':
cmd = 't'; cmd = 't';
@ -5854,7 +5861,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
/* saved password is blank, so don't bother asking */ /* saved password is blank, so don't bother asking */
password[0] = '\0'; password[0] = '\0';
} else { } 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"); ast_log(LOG_WARNING, "Unable to stream password file\n");
return -1; return -1;
} }
@ -6844,6 +6851,11 @@ static int load_config(void)
const char *extpc; const char *extpc;
const char *emaildateformatstr; const char *emaildateformatstr;
const char *volgainstr; const char *volgainstr;
const char *vm_paswd;
const char *vm_newpasswd;
const char *vm_passchange;
const char *vm_reenterpass;
const char *vm_mism;
int x; int x;
int tmpadsi[4]; int tmpadsi[4];
@ -7168,6 +7180,18 @@ static int load_config(void)
exitcontext[0] = '\0'; exitcontext[0] = '\0';
} }
/* load password sounds configuration */
if ((vm_paswd = ast_variable_retrieve(cfg, "general", "vm-password")))
ast_copy_string(vm_password, vm_paswd, sizeof(vm_password));
if ((vm_newpasswd = ast_variable_retrieve(cfg, "general", "vm-newpassword")))
ast_copy_string(vm_newpassword, vm_newpasswd, sizeof(vm_newpassword));
if ((vm_passchange = ast_variable_retrieve(cfg, "general", "vm-passchanged")))
ast_copy_string(vm_passchanged, vm_passchange, sizeof(vm_passchanged));
if ((vm_reenterpass = ast_variable_retrieve(cfg, "general", "vm-reenterpassword")))
ast_copy_string(vm_reenterpassword, vm_reenterpass, sizeof(vm_reenterpassword));
if ((vm_mism = ast_variable_retrieve(cfg, "general", "vm-mismatch")))
ast_copy_string(vm_mismatch, vm_mism, sizeof(vm_mismatch));
if (!(astdirfwd = ast_variable_retrieve(cfg, "general", "usedirectory"))) if (!(astdirfwd = ast_variable_retrieve(cfg, "general", "usedirectory")))
astdirfwd = "no"; astdirfwd = "no";
ast_set2_flag((&globalflags), ast_true(astdirfwd), VM_DIRECFORWARD); ast_set2_flag((&globalflags), ast_true(astdirfwd), VM_DIRECFORWARD);

@ -203,7 +203,25 @@ sendvoicemail=yes ; Context to Send voicemail from [option 5 from the advanced m
; greetings. The default is "no". ; greetings. The default is "no".
; hidefromdir=yes ; Hide this mailbox from the directory produced by app_directory ; hidefromdir=yes ; Hide this mailbox from the directory produced by app_directory
; The default is "no". ; The default is "no".
;tempgreetwarn=yes ; Remind the user that their temporary greeting is set ; tempgreetwarn=yes ; Remind the user that their temporary greeting is set
; vm-password=custom_sound
; Customize which sound file is used instead of the default
; prompt that says: "password"
; vm-newpassword=custom_sound
; Customize which sound file is used instead of the default
; prompt that says: "Please enter your new password followed by
; the pound key."
; vm-passchanged=custom_sound
; Customize which sound file is used instead of the default
; prompt that says: "Your password has been changed."
; vm-reenterpassword=custom_sound
; Customize which sound file is used instead of the default
; prompt that says: "Please re-enter your password followed by
; the pound key"
; vm-mismatch=custom_sound
; Customize which sound file is used instead of the default
; prompt that says: "The passwords you entered and re-entered
; did not match. Please try again."
[zonemessages] [zonemessages]
eastern=America/New_York|'vm-received' Q 'digits/at' IMp eastern=America/New_York|'vm-received' Q 'digits/at' IMp

Loading…
Cancel
Save