mirror of
https://github.com/openwrt/telephony.git
synced 2026-04-15 10:51:57 +00:00
asterisk: VM_MESSAGEFILE
Signed-off-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Paul Donald <newtwen+github@gmail.com>
This commit is contained in:
committed by
Jiri Slachta
parent
9ad2f46253
commit
a001cfba33
34
net/asterisk/patches/202-VM_MESSAGEFILE.patch
Normal file
34
net/asterisk/patches/202-VM_MESSAGEFILE.patch
Normal file
@@ -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;
|
||||
Reference in New Issue
Block a user