Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 60168) +++ apps/app_voicemail.c (working copy) @@ -168,6 +168,15 @@ #define VOICEMAIL_CONFIG "voicemail.conf" #define ASTERISK_USERNAME "asterisk" +/* Define fast-forward, pause, restart, and reverse keys + while listening to a voicemail message - these are + strings, not characters */ +#define DEFAULT_LISTEN_CONTROL_FORWARD_KEY "#" +#define DEFAULT_LISTEN_CONTROL_REVERSE_KEY "*" +#define DEFAULT_LISTEN_CONTROL_PAUSE_KEY "0" +#define DEFAULT_LISTEN_CONTROL_RESTART_KEY "2" +#define DEFAULT_LISTEN_CONTROL_STOP_KEY "13456789" + /* Default mail command to mail voicemail. Change it with the mailcmd= command in voicemail.conf */ #define SENDMAIL "/usr/sbin/sendmail -t" @@ -528,6 +537,13 @@ static int skipms; static int maxlogins; +/* custom audio control prompts for voicemail playback */ +static char listen_control_forward_key[12]; +static char listen_control_reverse_key[12]; +static char listen_control_pause_key[12]; +static char listen_control_restart_key[12]; +static char listen_control_stop_key[12]; + /* custom password sounds */ static char vm_password[80] = "vm-password"; static char vm_newpassword[80] = "vm-newpassword"; @@ -4236,7 +4252,7 @@ static int wait_file(struct ast_channel *chan, struct vm_state *vms, char *file) { - return ast_control_streamfile(chan, file, "#", "*", "1456789", "0", "2", skipms); + return ast_control_streamfile(chan, file, listen_control_forward_key, listen_control_reverse_key, listen_control_stop_key, listen_control_pause_key, listen_control_restart_key, skipms); } static int play_message_category(struct ast_channel *chan, const char *category) @@ -7192,10 +7208,18 @@ struct ast_variable *var; const char *val; const char *s; + const char *key; char *q, *stringp; int x; int tmpadsi[4]; + /* set audio control prompts */ + strcpy(listen_control_forward_key,DEFAULT_LISTEN_CONTROL_FORWARD_KEY); + strcpy(listen_control_reverse_key,DEFAULT_LISTEN_CONTROL_REVERSE_KEY); + strcpy(listen_control_pause_key,DEFAULT_LISTEN_CONTROL_PAUSE_KEY); + strcpy(listen_control_restart_key,DEFAULT_LISTEN_CONTROL_RESTART_KEY); + strcpy(listen_control_stop_key,DEFAULT_LISTEN_CONTROL_STOP_KEY); + cfg = ast_config_load(VOICEMAIL_CONFIG); AST_LIST_LOCK(&users); @@ -7563,6 +7587,17 @@ ast_copy_string(vm_reenterpassword, val, sizeof(vm_reenterpassword)); if ((val = ast_variable_retrieve(cfg, "general", "vm-mismatch"))) ast_copy_string(vm_mismatch, val, sizeof(vm_mismatch)); + /* load configurable audio prompts */ + if ((key = ast_variable_retrieve(cfg, "general", "listen-control-forward-key"))) + ast_copy_string(listen_control_forward_key, key, sizeof(listen_control_forward_key)); + if ((key = ast_variable_retrieve(cfg, "general", "listen-control-reverse-key"))) + ast_copy_string(listen_control_reverse_key, key, sizeof(listen_control_reverse_key)); + if ((key = ast_variable_retrieve(cfg, "general", "listen-control-pause-key"))) + ast_copy_string(listen_control_pause_key, key, sizeof(listen_control_pause_key)); + if ((key = ast_variable_retrieve(cfg, "general", "listen-control-restart-key"))) + ast_copy_string(listen_control_restart_key, key, sizeof(listen_control_restart_key)); + if ((key = ast_variable_retrieve(cfg, "general", "listen-control-stop-key"))) + ast_copy_string(listen_control_stop_key, key, sizeof(listen_control_stop_key)); if (!(val = ast_variable_retrieve(cfg, "general", "usedirectory"))) val = "no"; Index: configs/voicemail.conf.sample =================================================================== --- configs/voicemail.conf.sample (revision 60168) +++ configs/voicemail.conf.sample (working copy) @@ -236,7 +236,13 @@ ; 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." +; listen-control-forward-key=# ; Customize the key that fast-forwards message playback +; listen-control-reverse-key=* ; Customize the key that rewinds message playback +; listen-control-pause-key=0 ; Customize the key that pauses/unpauses message playback +; listen-control-restart-key=2 ; Customize the key that restarts message playback +; listen-control-stop-key=13456789 ; Customize the keys that interrupt message playback, probably all keys not set above + [zonemessages] eastern=America/New_York|'vm-received' Q 'digits/at' IMp central=America/Chicago|'vm-received' Q 'digits/at' IMp