summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Heider2026-01-21 09:30:03 +0000
committerJiri Slachta2026-02-23 19:12:42 +0000
commita001cfba33556273cd599868a34b9447aeda0539 (patch)
treed1326522f9defcc032eeb48f72649a4de8b8b863
parent9ad2f4625388af8ea00a7bf97518e4da158e79fc (diff)
downloadtelephony-master.tar.gz
asterisk: VM_MESSAGEFILEHEADmaster
Signed-off-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Paul Donald <newtwen+github@gmail.com>
-rw-r--r--net/asterisk/patches/202-VM_MESSAGEFILE.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/net/asterisk/patches/202-VM_MESSAGEFILE.patch b/net/asterisk/patches/202-VM_MESSAGEFILE.patch
new file mode 100644
index 0000000..b8b9e83
--- /dev/null
+++ b/net/asterisk/patches/202-VM_MESSAGEFILE.patch
@@ -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;