]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
make operator=no work correctly, fix typo (bug #2665)
authorRussell Bryant <russell@russellbryant.com>
Sat, 23 Oct 2004 11:55:21 +0000 (11:55 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sat, 23 Oct 2004 11:55:21 +0000 (11:55 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4058 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c
pbx.c

index 35ba7b4111f851a244e221bf0aecc4a668b057a8..399bd0b9c4bcdeb5e79f19bb5b4a7ce42d85d522 100755 (executable)
@@ -1418,16 +1418,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);
@@ -4653,9 +4659,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;
                        } 
@@ -4708,13 +4712,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
diff --git a/pbx.c b/pbx.c
index ed8f6837485ab317a11346f0c69af0eee438d2bb..13ab2b658c0a6fb519450b667b715a0927db1d4a 100755 (executable)
--- a/pbx.c
+++ b/pbx.c
@@ -4568,7 +4568,7 @@ static int pbx_builtin_background(struct ast_channel *chan, void *data)
                        res = ast_waitstream(chan, AST_DIGIT_ANY);
                        ast_stopstream(chan);
                } else {
-                       ast_log(LOG_WARNING, "ast_streamfile failed on %s fro %s\n", chan->name, (char*)data);
+                       ast_log(LOG_WARNING, "ast_streamfile failed on %s for %s\n", chan->name, (char*)data);
                        res = 0;
                }
        }