From 9d4d240b941e547912438487d5b91567803da743 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Sat, 9 Feb 2008 06:33:10 +0000 Subject: Merged revisions 103197 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r103197 | tilghman | 2008-02-09 00:23:49 -0600 (Sat, 09 Feb 2008) | 4 lines Commit fix for being unable to send voicemail from VoiceMailMain Reported by: William F Acker (via the -users mailing list) Patch by: Corydon76 (license 14) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103198 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_voicemail.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 7a679a04e..b15c504b5 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -4399,7 +4399,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)); -- cgit v1.2.3