aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-28 21:50:50 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-28 21:50:50 +0000
commit9a8d5fc63df489b79481f8a454c91dac57742f40 (patch)
treebedeee6c3a8b68c9ad3db4beb7b3ebb6415106e0
parent8386021d8ca09905505e9fa7e6e316624d8e3a6c (diff)
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/branches/1.4@134161 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_voicemail.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index cf71c5f8a..09c90e588 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1994,11 +1994,18 @@ static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, in
if (option_debug > 2)
ast_log(LOG_DEBUG, "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;
- if (option_debug > 2)
- ast_log(LOG_DEBUG, "VOLGAIN: Stored at: %s.%s - Level: %.4f - Mailbox: %s\n", attach, format, vmu->volgain, mailbox);
+ if ((soxstatus = ast_safe_system(tmpcmd)) == 0) {
+ attach = newtmp;
+ if (option_debug > 2) {
+ ast_log(LOG_DEBUG, "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);