aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-28 22:07:12 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-28 22:07:12 +0000
commitde2a30076532d8be81129eab5de6d4011501452a (patch)
treeedf04d88456c8ffec53b7a852e35fcd885e0fb52 /apps
parent5e46b9f94eb73ce6ab27f3066c773f067c8ac117 (diff)
Merged revisions 134161 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r134161 | tilghman | 2008-07-28 16:50:50 -0500 (Mon, 28 Jul 2008) | 7 lines Detect when sox fails to raise the volume, because sox can't read the file. (closes issue #12939) Reported by: rickbradley Patches: 20080728__bug12939.diff.txt uploaded by Corydon76 (license 14) Tested by: rickbradley ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@134163 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-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 e83eaf270..8a7b2aaee 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -2600,10 +2600,16 @@ static int add_email_attachment(FILE *p, struct ast_vm_user *vmu, char *format,
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);