[asterisk-commits] seanbright: branch 1.6.2 r316708 - in /branches/1.6.2: ./ apps/app_voicemail.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed May 4 11:11:04 CDT 2011
Author: seanbright
Date: Wed May 4 11:10:59 2011
New Revision: 316708
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=316708
Log:
Merged revisions 316707 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r316707 | seanbright | 2011-05-04 12:08:50 -0400 (Wed, 04 May 2011) | 8 lines
If sox fails when processing a voicemail, don't delete the original file.
(closes issue #18111)
Reported by: sysreq
Patches:
issue18111_trunk.patch uploaded by seanbright (license 71)
Tested by: seanbright
........
Modified:
branches/1.6.2/ (props changed)
branches/1.6.2/apps/app_voicemail.c
Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: branches/1.6.2/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/apps/app_voicemail.c?view=diff&rev=316708&r1=316707&r2=316708
==============================================================================
--- branches/1.6.2/apps/app_voicemail.c (original)
+++ branches/1.6.2/apps/app_voicemail.c Wed May 4 11:10:59 2011
@@ -4582,6 +4582,7 @@
char fname[256];
char tmpcmd[256];
int tmpfd = -1;
+ int soxstatus = 0;
/* Eww. We want formats to tell us their own MIME type */
char *ctype = (!strcasecmp(format, "ogg")) ? "application/" : "audio/x-";
@@ -4593,7 +4594,6 @@
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);
if ((soxstatus = ast_safe_system(tmpcmd)) == 0) {
attach = newtmp;
@@ -4621,7 +4621,9 @@
if (last)
fprintf(p, ENDL ENDL "--%s--" ENDL "." ENDL, bound);
if (tmpfd > -1) {
- unlink(fname);
+ if (soxstatus == 0) {
+ unlink(fname);
+ }
close(tmpfd);
unlink(newtmp);
}
More information about the asterisk-commits
mailing list