]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_voicemail: VoiceMailPlayMsg did not play database stored messages 34/4934/2
authorrrittgarn <rrittgarn@techpro.com>
Wed, 25 Jan 2017 22:25:21 +0000 (16:25 -0600)
committerKevin Harwell <kharwell@digium.com>
Tue, 14 Feb 2017 18:58:15 +0000 (12:58 -0600)
When attempting to use VoiceMailPlayMsg with a realtime data backend
the message is located, but never retrieved. This patch adds the
required RETRIEVE and DISPOSE calls that will fetch the message from
the database (and IMAP storage as well for that matter).

Also, removed extraneous make_file call.

ASTERISK-26723 #close

Change-Id: I1e122dd53c0f3d7faa10f3c2b7e7e76a47d51b8c

apps/app_voicemail.c

index fe76bc0e3ccc063453e7ebfb4924df095112ff23..cc3e6faf6ec8bfbc54ccf7367c09977d67095a4a 100644 (file)
@@ -11206,7 +11206,6 @@ static int play_message_by_id_helper(struct ast_channel *chan,
        /* Found the msg, so play it back */
 
        make_file(vms->fn, sizeof(vms->fn), vms->curdir, vms->curmsg);
-       make_file(vms->fn, sizeof(vms->fn), vms->curdir, vms->curmsg);
 
 #ifdef IMAP_STORAGE
        /*IMAP storage stores any prepended message from a forward
@@ -11216,6 +11215,8 @@ static int play_message_by_id_helper(struct ast_channel *chan,
                wait_file(chan, vms, vms->introfn);
        }
 #endif
+       RETRIEVE(vms->curdir,vms->curmsg,vmu->mailbox, vmu->context);
+
        if ((wait_file(chan, vms, vms->fn)) < 0) {
                ast_log(AST_LOG_WARNING, "Playback of message %s failed\n", vms->fn);
        } else {
@@ -11227,7 +11228,7 @@ static int play_message_by_id_helper(struct ast_channel *chan,
                ast_mutex_unlock(&vms->lock);
 #endif
        }
-
+       DISPOSE(vms->curdir, vms->curmsg);
        return 0;
 }