Add some extra checks & verbosity (bug #3686)
authorMark Spencer <markster@digium.com>
Tue, 1 Mar 2005 04:50:52 +0000 (04:50 +0000)
committerMark Spencer <markster@digium.com>
Tue, 1 Mar 2005 04:50:52 +0000 (04:50 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5110 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index 021b59a..8f7adb3 100755 (executable)
@@ -4436,15 +4436,20 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
                logretries++;
                if (!valid) {
                        if (skipuser || logretries >= maxlogins) {
-                               if (ast_streamfile(chan, "vm-incorrect", chan->language))
-                                       break;
+                               if (ast_streamfile(chan, "vm-incorrect", chan->language)) {
+                                       ast_log(LOG_WARNING, "Unable to stream incorrect message\n");
+                                       return -1;
+                               }
                        } else {
                                if (useadsi)
                                        adsi_login(chan);
-                               if (ast_streamfile(chan, "vm-incorrect-mailbox", chan->language))
-                                       break;
+                               if (ast_streamfile(chan, "vm-incorrect-mailbox", chan->language)) {
+                                       ast_log(LOG_WARNING, "Unable to stream incorrect mailbox message\n");
+                                       return -1;
+                               }
                        }
-                       ast_waitstream(chan, "");
+                       if (ast_waitstream(chan, ""))   /* Channel is hung up */
+                               return -1;
                }
        }
        if (!valid && (logretries >= maxlogins)) {