aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-17 22:13:05 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-17 22:13:05 +0000
commit3a7aff1f3bd0a0ddf406d83d3b6ffcf1dc1c77ef (patch)
treeb68846ec425ce1bb717d2ea9a49ad679234796dd /apps
parentdbbf2cc59f7198c9ecdabf3d291ec32bb856287a (diff)
Thread fixes, vm fix (bug #2665)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4030 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-xapps/app_voicemail.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 31b81dee1..bd01be0fe 100755
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1332,16 +1332,22 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, int silent, int
}
/* Check for a '0' here */
if (res == '0') {
- transfer:
- strncpy(chan->exten, "o", sizeof(chan->exten) - 1);
- if (!ast_strlen_zero(vmu->exit)) {
- strncpy(chan->context, vmu->exit, sizeof(chan->context) - 1);
- } else if (ousemacro && !ast_strlen_zero(chan->macrocontext)) {
- strncpy(chan->context, chan->macrocontext, sizeof(chan->context) - 1);
+ transfer:
+ if (vmu->operator) {
+ strncpy(chan->exten, "o", sizeof(chan->exten) - 1);
+ if (!ast_strlen_zero(vmu->exit)) {
+ strncpy(chan->context, vmu->exit, sizeof(chan->context) - 1);
+ } else if (ousemacro && !ast_strlen_zero(chan->macrocontext)) {
+ strncpy(chan->context, chan->macrocontext, sizeof(chan->context) - 1);
+ }
+ ast_play_and_wait(chan, "transfer");
+ chan->priority = 0;
+ free_user(vmu);
+ return 0;
+ } else {
+ ast_play_and_wait(chan, "vm-sorry");
+ return 0;
}
- chan->priority = 0;
- free_user(vmu);
- return 0;
}
if (res < 0) {
free_user(vmu);
@@ -4605,9 +4611,7 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
/* User has hung up, no options to give */
return res;
if (cmd == '0') {
- /* Erase the message if 0 pushed during playback */
- ast_play_and_wait(chan, "vm-deleted");
- vm_delete(recordfile);
+ break;
} else if (cmd == '*') {
break;
}
@@ -4660,13 +4664,11 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
return 1;
#endif
case '0':
- if (outsidecaller && vmu->operator) {
- if (message_exists)
- ast_play_and_wait(chan, "vm-msgsaved");
- return cmd;
- } else
- cmd = ast_play_and_wait(chan, "vm-sorry");
- break;
+ if (message_exists || recorded) {
+ ast_play_and_wait(chan, "vm-deleted");
+ vm_delete(recordfile);
+ }
+ return cmd;
default:
/* If the caller is an ouside caller, and the review option is enabled,
allow them to review the message, but let the owner of the box review