From b92b22c5084f1a3a86c1be9e5ff21a6253905566 Mon Sep 17 00:00:00 2001 From: tilghman Date: Mon, 28 Jul 2008 22:16:39 +0000 Subject: Merged revisions 134163 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r134163 | tilghman | 2008-07-28 17:07:12 -0500 (Mon, 28 Jul 2008) | 15 lines 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/branches/1.6.0@134164 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_voicemail.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'apps') 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); -- cgit v1.2.3