]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix short message isssue (bug #2723)
authorMark Spencer <markster@digium.com>
Tue, 26 Oct 2004 02:21:43 +0000 (02:21 +0000)
committerMark Spencer <markster@digium.com>
Tue, 26 Oct 2004 02:21:43 +0000 (02:21 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4098 65c4cc65-6c06-0410-ace0-fbb531ad65f3

app.c
apps/app_voicemail.c

diff --git a/app.c b/app.c
index 0b277b5ceb41e697017d4f41a9721cd7d86406ea..5e57a86fbd01589dbc4d056d5c2faf0ad36e0af6 100755 (executable)
--- a/app.c
+++ b/app.c
@@ -710,10 +710,12 @@ int ast_play_and_record(struct ast_channel *chan, char *playfile, char *recordfi
        for (x=0;x<fmtcnt;x++) {
                if (!others[x])
                        break;
-               if (totalsilence)
-                       ast_stream_rewind(others[x], totalsilence-200);
-               else
-                       ast_stream_rewind(others[x], 200);
+               if (res > 0) {
+                       if (totalsilence)
+                               ast_stream_rewind(others[x], totalsilence-200);
+                       else
+                               ast_stream_rewind(others[x], 200);
+               }
                ast_truncstream(others[x]);
                ast_closestream(others[x]);
        }
@@ -722,14 +724,11 @@ int ast_play_and_record(struct ast_channel *chan, char *playfile, char *recordfi
                        ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
                }
        }
-       if (outmsg) {
-               if (outmsg > 1) {
+       if (outmsg > 1) {
                /* Let them know recording is stopped */
-                       ast_streamfile(chan, "auth-thankyou", chan->language);
+               if(!ast_streamfile(chan, "auth-thankyou", chan->language))
                        ast_waitstream(chan, "");
-               }
        }
-
        return res;
 }
 
index 31c02dbb293eaf601ec41b5948cb7a7673f4d6c2..424306c42e2e69aa52ed222c82b9db099151d647 100755 (executable)
@@ -4609,7 +4609,7 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
                        cmd = ast_play_and_record(chan, playfile, recordfile, maxtime, fmt, duration, silencethreshold, maxsilence);
                        if (cmd == -1)
                        /* User has hung up, no options to give */
-                               return res;
+                               return cmd;
                        if (cmd == '0') {
                                break;
                        } else if (cmd == '*') {
@@ -4704,7 +4704,7 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
                }
        }
        if (outsidecaller)  
-               ast_play_and_wait(chan, "vm-goodbye");
+               ast_play_and_wait(chan, "vm-goodbye");
        if (cmd == 't')
                cmd = 0;
        return cmd;