Index: apps/app_mixmonitor.c =================================================================== --- apps/app_mixmonitor.c (revision 69470) +++ apps/app_mixmonitor.c (working copy) @@ -41,6 +41,7 @@ #include #include #include +#include #include "asterisk/file.h" #include "asterisk/logger.h" @@ -305,6 +306,7 @@ struct ast_module_user *u; struct ast_flags flags = {0}; char *parse; + char tmp[256]; AST_DECLARE_APP_ARGS(args, AST_APP_ARG(filename); AST_APP_ARG(options); @@ -372,6 +374,8 @@ sprintf(build, "%s/%s", ast_config_AST_MONITOR_DIR, args.filename); args.filename = build; } + snprintf (tmp, sizeof(tmp), "mkdir -p \"%s\"", dirname(ast_strdupa(args.filename))); + ast_safe_system(tmp); pbx_builtin_setvar_helper(chan, "MIXMONITOR_FILENAME", args.filename); launch_monitor_thread(chan, args.filename, flags.flags, readvol, writevol, args.post_process);