asterisk: VM_MESSAGEFILE master
authorAndre Heider <a.heider@gmail.com>
Wed, 21 Jan 2026 09:30:03 +0000 (10:30 +0100)
committerJiri Slachta <jiri.slachta@gmail.com>
Mon, 23 Feb 2026 19:12:42 +0000 (20:12 +0100)
Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
net/asterisk/patches/202-VM_MESSAGEFILE.patch [new file with mode: 0644]

diff --git a/net/asterisk/patches/202-VM_MESSAGEFILE.patch b/net/asterisk/patches/202-VM_MESSAGEFILE.patch
new file mode 100644 (file)
index 0000000..b8b9e83
--- /dev/null
@@ -0,0 +1,34 @@
+From e8b2e65d2130c5b1841dc4a456bfb79aa017a37e Mon Sep 17 00:00:00 2001
+From: Andre Heider <a.heider@gmail.com>
+Date: Wed, 21 Jan 2026 10:28:50 +0100
+Subject: [PATCH] VM_MESSAGEFILE
+
+---
+ apps/app_voicemail.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/apps/app_voicemail.c
++++ b/apps/app_voicemail.c
+@@ -5889,6 +5889,7 @@ static int sendmail(char *srcemail,
+       char tmp[80] = "/tmp/astmail-XXXXXX";
+       char tmp2[256];
+       char *stringp;
++      char fname[PATH_MAX] = "";
+       if (vmu && ast_strlen_zero(vmu->email)) {
+               ast_log(AST_LOG_WARNING, "E-mail address missing for mailbox [%s].  E-mail will not be sent.\n", vmu->mailbox);
+@@ -5912,7 +5913,14 @@ static int sendmail(char *srcemail,
+               make_email_file(p, srcemail, vmu, msgnum, context, mailbox, fromfolder, cidnum, cidname, attach, attach2, format, duration, attach_user_voicemail, chan, category, 0, flag, msg_id);
+               fclose(p);
+               snprintf(tmp2, sizeof(tmp2), "( %s < %s ; rm -f %s ) &", mailcmd, tmp, tmp);
++              if (ast_strlen_zero(attach)) {
++                      unsetenv("VM_MESSAGEFILE");
++              } else {
++                      snprintf(fname, sizeof(fname), "%s.%s", attach, format);
++                      setenv("VM_MESSAGEFILE", fname, 1);
++              }
+               ast_safe_system(tmp2);
++              unsetenv("VM_MESSAGEFILE");
+               ast_debug(1, "Sent mail to %s with command '%s'\n", vmu->email, mailcmd);
+       }
+       return 0;