issue #5718
authorKevin P. Fleming <kpfleming@digium.com>
Sat, 12 Nov 2005 02:34:01 +0000 (02:34 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Sat, 12 Nov 2005 02:34:01 +0000 (02:34 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7084 65c4cc65-6c06-0410-ace0-fbb531ad65f3

ChangeLog
apps/app_voicemail.c

index 4415a0f..5ecdeae 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2005-11-11  Kevin P. Fleming  <kpfleming@digium.com>
 
+       * apps/app_voicemail.c (forward_message): correct bugs in message forwarding (issue #5718)
+
        * apps/app_dial.c (wait_for_answer): correct flag copying for automon feature (issue #5720)
 
        * channels/chan_iax2.c: correct comment
index 0ed74f8..c8a694c 100755 (executable)
@@ -3479,10 +3479,16 @@ static int forward_message(struct ast_channel *chan, char *context, char *dir, i
                                ast_log(LOG_DEBUG, "%s", sys);
                                ast_safe_system(sys);
                
-                               if ( (res = count_messages(receiver, todir)) )
+                               res = count_messages(receiver, todir);
+
+                               if ( (res == ERROR_LOCK_PATH) || (res < 0) ) {
+                                       if (res == ERROR_LOCK_PATH)
+                                               ast_log(LOG_WARNING, "Unable to lock the directory %s to forward the requested vmail msg!\n", todir);
+                                       else
+                                               ast_log(LOG_WARNING, "Unable to determine how many msgs are in the destination folder!\n");
                                        break;
-                               else
-                                       todircount = res;
+                               }
+                               todircount = res;
                                ast_copy_string(tmp, fmt, sizeof(tmp));
                                stringp = tmp;
                                while ((s = strsep(&stringp, "|"))) {
@@ -3547,8 +3553,7 @@ static int forward_message(struct ast_channel *chan, char *context, char *dir, i
                                        res = ast_play_and_wait(chan, "vm-messages");
                                if (!res)
                                        res = ast_play_and_wait(chan, "vm-saved"); */
-                               if (!res)
-                                       res = ast_play_and_wait(chan, "vm-msgsaved");
+                               res = ast_play_and_wait(chan, "vm-msgsaved");
                        }       
                }
        }