[asterisk-commits] tilghman: trunk r134163 - in /trunk: ./ apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 28 17:07:13 CDT 2008


Author: tilghman
Date: Mon Jul 28 17:07:12 2008
New Revision: 134163

URL: http://svn.digium.com/view/asterisk?view=rev&rev=134163
Log:
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

........

Modified:
    trunk/   (props changed)
    trunk/apps/app_voicemail.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=134163&r1=134162&r2=134163
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Mon Jul 28 17:07:12 2008
@@ -2600,10 +2600,16 @@
 		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);




More information about the asterisk-commits mailing list