summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Peeler <jpeeler@digium.com>2010-10-18 21:56:45 +0000
committerJeff Peeler <jpeeler@digium.com>2010-10-18 21:56:45 +0000
commit96519117bb65426b04a258856d8f0caafcc1e6a4 (patch)
tree3c610de639fc4298344890db7bf9216d7b3287b5
parent84cbd3249af7dce348c6097fb1fff3887aa814fd (diff)
Merged revisions 292227 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r292227 | jpeeler | 2010-10-18 16:55:46 -0500 (Mon, 18 Oct 2010) | 25 lines Merged revisions 292226 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r292226 | jpeeler | 2010-10-18 16:54:38 -0500 (Mon, 18 Oct 2010) | 18 lines Merged revisions 292223 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r292223 | jpeeler | 2010-10-18 16:50:30 -0500 (Mon, 18 Oct 2010) | 11 lines Fix improper operator key acceptance and clean up temp recording files. This is a fix for when pressing the operator key after recording an unavailable, busy, name, or temporary message in mailbox options. The operator key should not be accepted here, but should be allowed during the message recording. If the operator key is pressed during ensure the file is saved or deleted as apporopriate. Also, ensure removal of temporary recorded files after an early hang up or when message acceptance confirmation times out. ABE-2518 ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@292228 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--apps/app_voicemail.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index d60c58aac..e80261c01 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -12888,6 +12888,7 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
char tempfile[PATH_MAX];
char *acceptdtmf = "#";
char *canceldtmf = "";
+ int canceleddtmf = 0;
/* Note that urgent and private are for flagging messages as such in the future */
@@ -12949,6 +12950,10 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
if (ast_test_flag(vmu, VM_OPERATOR))
canceldtmf = "0";
cmd = ast_play_and_record_full(chan, playfile, tempfile, maxtime, fmt, duration, silencethreshold, maxsilence, unlockdir, acceptdtmf, canceldtmf);
+ if (strchr(canceldtmf, cmd)) {
+ /* need this flag here to distinguish between pressing '0' during message recording or after */
+ canceleddtmf = 1;
+ }
if (record_gain)
ast_channel_setoption(chan, AST_OPTION_RXGAIN, &zero_gain, sizeof(zero_gain), 0);
if (cmd == -1) {
@@ -13028,7 +13033,7 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
return 1;
#endif
case '0':
- if (!ast_test_flag(vmu, VM_OPERATOR) || !outsidecaller) {
+ if (!ast_test_flag(vmu, VM_OPERATOR) || (!canceleddtmf && !outsidecaller)) {
cmd = ast_play_and_wait(chan, "vm-sorry");
break;
}
@@ -13037,6 +13042,7 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
if (!cmd)
cmd = ast_waitfordigit(chan, 3000);
if (cmd == '1') {
+ ast_filerename(tempfile, recordfile, NULL);
ast_play_and_wait(chan, "vm-msgsaved");
cmd = '0';
} else if (cmd == '4') {
@@ -13048,7 +13054,7 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
cmd = '0';
} else {
ast_play_and_wait(chan, "vm-deleted");
- DELETE(recordfile, -1, recordfile, vmu);
+ DELETE(tempfile, -1, tempfile, vmu);
cmd = '0';
}
}
@@ -13093,6 +13099,10 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
}
}
}
+ if (!outsidecaller && (cmd == -1 || cmd == 't')) {
+ /* Hang up or timeout, so delete the recording. */
+ ast_filedelete(tempfile, NULL);
+ }
if (cmd == 't')
cmd = 0;
else if (outsidecaller) /* won't play if time out occurs */