]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Bug 6783 - When context is specified, voicemail should look for mailboxes in that...
authorTilghman Lesher <tilghman@meg.abyt.es>
Sat, 25 Mar 2006 04:09:04 +0000 (04:09 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Sat, 25 Mar 2006 04:09:04 +0000 (04:09 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@14821 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index 85be0cd41c9238995269383aef3c18f64f6a18ee..00b755cf61890a35ebe05d6ff4b8f1e401eb31e9 100644 (file)
@@ -3483,11 +3483,13 @@ static int forward_message(struct ast_channel *chan, char *context, char *dir, i
        vmtmp = extensions;
        if (flag==1) {
                struct leave_vm_options leave_options;
+               char mailbox[AST_MAX_EXTENSION * 2 + 2];
+               snprintf(mailbox, sizeof(mailbox), "%s@%s", username, context);
 
                /* Send VoiceMail */
                memset(&leave_options, 0, sizeof(leave_options));
                leave_options.record_gain = record_gain;
-               cmd = leave_voicemail(chan, username, &leave_options);
+               cmd = leave_voicemail(chan, mailbox, &leave_options);
        } else {
                /* Forward VoiceMail */
                RETRIEVE(dir, curmsg);
@@ -6522,13 +6524,15 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
                        } else {
                                if (find_user(NULL, vmu->context, num)) {
                                        struct leave_vm_options leave_options;
+                                       char mailbox[AST_MAX_EXTENSION * 2 + 2];
+                                       snprintf(mailbox, sizeof(mailbox), "%s@%s", num, vmu->context);
 
                                        if (option_verbose > 2)
                                                ast_verbose(VERBOSE_PREFIX_3 "Leaving voicemail for '%s' in context '%s'\n", num, vmu->context);
                                        
                                        memset(&leave_options, 0, sizeof(leave_options));
                                        leave_options.record_gain = record_gain;
-                                       res = leave_voicemail(chan, num, &leave_options);
+                                       res = leave_voicemail(chan, mailbox, &leave_options);
                                        if (!res)
                                                res = 't';
                                        return res;