]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Commit fix for being unable to send voicemail from VoiceMailMain
authorTilghman Lesher <tilghman@meg.abyt.es>
Sat, 9 Feb 2008 06:23:49 +0000 (06:23 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Sat, 9 Feb 2008 06:23:49 +0000 (06:23 +0000)
 Reported by: William F Acker (via the -users mailing list)
 Patch by: Corydon76 (license 14)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103197 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index 4cf6895d14bf6af3983f13f8789a8fb0b2b22bfe..85afac465c035e009b636ec404a90d820d54c43d 100644 (file)
@@ -4117,7 +4117,11 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
        if (flag==1) {
                struct leave_vm_options leave_options;
                char mailbox[AST_MAX_EXTENSION * 2 + 2];
-               snprintf(mailbox, sizeof(mailbox), "%s@%s", username, context);
+               /* Make sure that context doesn't get set as a literal "(null)" (or else find_user won't find it) */
+               if (context)
+                       snprintf(mailbox, sizeof(mailbox), "%s@%s", username, context);
+               else
+                       ast_copy_string(mailbox, username, sizeof(mailbox));
 
                /* Send VoiceMail */
                memset(&leave_options, 0, sizeof(leave_options));