summaryrefslogtreecommitdiff
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2011-07-26 14:17:13 +0000
committerJonathan Rose <jrose@digium.com>2011-07-26 14:17:13 +0000
commit462e0fe5307828e3a06c1855b2bc9020f96e2d6e (patch)
treef7a56166cce49a3da92909ed56f0840f23ab1db0 /apps/app_voicemail.c
parent06343443e1d266b65f110c69e8e78a22f12aaedd (diff)
Merged revisions 329528 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r329528 | jrose | 2011-07-26 08:52:34 -0500 (Tue, 26 Jul 2011) | 24 lines Merged revisions 329527 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r329527 | jrose | 2011-07-26 08:25:35 -0500 (Tue, 26 Jul 2011) | 17 lines Fixes some voicemail forwarding behavior based around prepend mode. Formerly, prepend forwarding would have the user record a message with no useful prompt and an expectation for the user to push a button on the phone when finished recording. If a length of silence was detected instead, the recording would be canceled and the user would re-enter the voicemail forwarding menu. Subsequent time-outs in prepend recording would also bug out in the sense that they would write over the original message and get sent to the recipient regardless of whether they timed out or were accepted. This patch fixes this issue and adds a prompt which will be played after a timeout informing the user that they needed to press a button. Currently, the sound files that we have are somewhat inadquate for this, so after the call we simply have Allison say "Please try again. Then press pound." which actually relies on two separate sound files. Just one would be more appropriate. reporter: Vlad Povorozniuc Review: https://reviewboard.asterisk.org/r/1327/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@329530 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r--apps/app_voicemail.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 764a44520..da2d99213 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -863,6 +863,18 @@ static char vm_mismatch[80] = "vm-mismatch";
static char vm_invalid_password[80] = "vm-invalid-password";
static char vm_pls_try_again[80] = "vm-pls-try-again";
+/*
+ * XXX If we have the time, motivation, etc. to fix up this prompt, one of the following would be appropriate:
+ * 1. create a sound along the lines of "Please try again. When done, press the pound key" which could be spliced
+ * from existing sound clips. This would require some programming changes in the area of vm_forward options and also
+ * app.c's __ast_play_and_record function
+ * 2. create a sound prompt saying "Please try again. When done recording, press any key to stop and send the prepended
+ * message." At the time of this comment, I think this would require new voice work to be commissioned.
+ * 3. Something way different like providing instructions before a time out or a post-recording menu. This would require
+ * more effort than either of the other two.
+ */
+static char vm_prepend_timeout[80] = "then-press-pound";
+
static struct ast_flags globalflags = {0};
static int saydurationminfo;
@@ -6866,7 +6878,10 @@ static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu,
ast_channel_setoption(chan, AST_OPTION_RXGAIN, &record_gain, sizeof(record_gain), 0);
cmd = ast_play_and_prepend(chan, NULL, msgfile, 0, vm_fmts, &prepend_duration, 1, silencethreshold, maxsilence);
- if (cmd == 'S') {
+
+ if (cmd == 'S') { /* If we timed out, tell the user it didn't work properly and clean up the files */
+ ast_stream_and_wait(chan, vm_pls_try_again, ""); /* this might be removed if a proper vm_prepend_timeout is ever recorded */
+ ast_stream_and_wait(chan, vm_prepend_timeout, "");
ast_filerename(backup, msgfile, NULL);
}
@@ -6903,6 +6918,9 @@ static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu,
cmd = '*';
break;
default:
+ /* If time_out and return to menu, reset already_recorded */
+ already_recorded = 0;
+
cmd = ast_play_and_wait(chan, "vm-forwardoptions");
/* "Press 1 to prepend a message or 2 to forward the message without prepending" */
if (!cmd)
@@ -6912,8 +6930,9 @@ static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu,
cmd = ast_waitfordigit(chan, 6000);
if (!cmd)
retries++;
- if (retries > 3)
- cmd = 't';
+ if (retries > 3) {
+ cmd = '*'; /* Let's cancel this beast */
+ }
}
}
@@ -6928,7 +6947,7 @@ static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu,
rename(backup_textfile, textfile);
}
- if (cmd == 't' || cmd == 'S')
+ if (cmd == 't' || cmd == 'S') /* XXX entering this block with a value of 'S' is probably no longer possible. */
cmd = 0;
return cmd;
}
@@ -12138,6 +12157,9 @@ static int load_config(int reload)
if ((val = ast_variable_retrieve(cfg, "general", "vm-pls-try-again"))) {
ast_copy_string(vm_pls_try_again, val, sizeof(vm_pls_try_again));
}
+ if ((val = ast_variable_retrieve(cfg, "general", "vm-prepend-timeout"))) {
+ ast_copy_string(vm_prepend_timeout, val, sizeof(vm_prepend_timeout));
+ }
/* load configurable audio prompts */
if ((val = ast_variable_retrieve(cfg, "general", "listen-control-forward-key")) && is_valid_dtmf(val))
ast_copy_string(listen_control_forward_key, val, sizeof(listen_control_forward_key));