#include "asterisk/threadstorage.h"
#include "asterisk/strings.h"
#include "asterisk/pbx.h"
+#include "asterisk/app.h"
#if defined(__linux__) && !defined(__NR_gettid)
#include <asm/unistd.h>
char buf[512];
pbx_builtin_setvar_helper(c, "filename", filename);
pbx_substitute_variables_helper(c, exec_after_rotate, buf, sizeof(buf));
- if (system(buf) < 0) {
- ast_log(LOG_WARNING, "system() failed for '%s': %s\n", buf, strerror(errno));
+ if (ast_safe_system(buf) != -1) {
+ ast_log(LOG_WARNING, "error executing '%s'\n", buf);
}
ast_channel_free(c);
}