[asterisk-commits] tilghman: trunk r71268 - /trunk/apps/app_mixmonitor.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Jun 24 11:20:18 CDT 2007
Author: tilghman
Date: Sun Jun 24 11:20:18 2007
New Revision: 71268
URL: http://svn.digium.com/view/asterisk?view=rev&rev=71268
Log:
Issue 9970 - Ensure directory exists before trying to write an output file
Modified:
trunk/apps/app_mixmonitor.c
Modified: trunk/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_mixmonitor.c?view=diff&rev=71268&r1=71267&r2=71268
==============================================================================
--- trunk/apps/app_mixmonitor.c (original)
+++ trunk/apps/app_mixmonitor.c Sun Jun 24 11:20:18 2007
@@ -304,7 +304,7 @@
int x, readvol = 0, writevol = 0;
struct ast_module_user *u;
struct ast_flags flags = {0};
- char *parse;
+ char *parse, *tmp, *slash;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(filename);
AST_APP_ARG(options);
@@ -373,6 +373,11 @@
args.filename = build;
}
+ tmp = ast_strdupa(args.filename);
+ if ((slash = strrchr(tmp, '/')))
+ *slash = '\0';
+ ast_mkdir(tmp, 0777);
+
pbx_builtin_setvar_helper(chan, "MIXMONITOR_FILENAME", args.filename);
launch_monitor_thread(chan, args.filename, flags.flags, readvol, writevol, args.post_process);
More information about the asterisk-commits
mailing list