Index: apps/app_mixmonitor.c =================================================================== --- apps/app_mixmonitor.c (revision 69624) +++ apps/app_mixmonitor.c (working copy) @@ -41,6 +41,7 @@ #include #include #include +#include #include "asterisk/file.h" #include "asterisk/logger.h" @@ -302,6 +303,7 @@ static int mixmonitor_exec(struct ast_channel *chan, void *data) { int x, readvol = 0, writevol = 0; + int res; struct ast_module_user *u; struct ast_flags flags = {0}; char *parse; @@ -372,6 +374,8 @@ sprintf(build, "%s/%s", ast_config_AST_MONITOR_DIR, args.filename); args.filename = build; } + if ((res = ast_mkdir(dirname(ast_strdupa(args.filename)), 0755))) + ast_log(LOG_WARNING, "ast_mkdir failed: %s\n", strerror(res)); pbx_builtin_setvar_helper(chan, "MIXMONITOR_FILENAME", args.filename); launch_monitor_thread(chan, args.filename, flags.flags, readvol, writevol, args.post_process);