aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r--apps/app_voicemail.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index ccf89babd..b9b662bee 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -2169,10 +2169,16 @@ static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, in
chmod(newtmp, VOICEMAIL_FILE_MODE & ~my_umask);
ast_debug(3, "newtmp: %s\n", newtmp);
if (tmpfd > -1) {
+ int soxstatus;
snprintf(tmpcmd, sizeof(tmpcmd), "sox -v %.4f %s.%s %s.%s", vmu->volgain, attach, format, newtmp, format);
- ast_safe_system(tmpcmd);
- attach = newtmp;
- ast_debug(3, "VOLGAIN: Stored at: %s.%s - Level: %.4f - Mailbox: %s\n", attach, format, vmu->volgain, mailbox);
+ if ((soxstatus = ast_safe_system(tmpcmd)) == 0) {
+ attach = newtmp;
+ ast_debug(3, "VOLGAIN: Stored at: %s.%s - Level: %.4f - Mailbox: %s\n", attach, format, vmu->volgain, mailbox);
+ } else {
+ ast_log(LOG_WARNING, "Sox failed to reencode %s.%s: %s (have you installed support for all sox file formats?)\n", attach, format,
+ soxstatus == 1 ? "Problem with command line options" : "An error occurred during file processing");
+ ast_log(LOG_WARNING, "Voicemail attachment will have no volume gain.\n");
+ }
}
}
fprintf(p, "--%s" ENDL, bound);