diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c index ef35637c95..7a9757ed1b 100644 --- a/apps/app_externalivr.c +++ b/apps/app_externalivr.c @@ -50,6 +50,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/linkedlists.h" #include "asterisk/app.h" #include "asterisk/utils.h" +#include "asterisk/options.h" static const char *app = "ExternalIVR"; @@ -316,6 +317,9 @@ static int app_exec(struct ast_channel *chan, void *data) /* child process */ int i; + if (ast_opt_high_priority) + ast_set_priority(0); + dup2(child_stdin[0], STDIN_FILENO); dup2(child_stdout[1], STDOUT_FILENO); dup2(child_stderr[1], STDERR_FILENO); diff --git a/apps/app_festival.c b/apps/app_festival.c index f06cbaef3f..223aca571f 100644 --- a/apps/app_festival.c +++ b/apps/app_festival.c @@ -55,6 +55,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/config.h" #include "asterisk/utils.h" #include "asterisk/lock.h" +#include "asterisk/options.h" #define FESTIVAL_CONFIG "festival.conf" @@ -140,6 +141,9 @@ static int send_waveform_to_fd(char *waveform, int length, int fd) { if (x != fd) close(x); } + if (ast_opt_high_priority) + ast_set_priority(0); + /*IAS */ #ifdef __PPC__ for( x=0; xfds[0], STDIN_FILENO); + /* Drop high priority */ + if (ast_opt_high_priority) + ast_set_priority(0); + /* Close other file descriptors */ for (x=STDERR_FILENO + 1;x<1024;x++) close(x); diff --git a/asterisk.c b/asterisk.c index db5bf122ce..e256d3f07b 100644 --- a/asterisk.c +++ b/asterisk.c @@ -635,6 +635,8 @@ int ast_safe_system(const char *s) pid = fork(); if (pid == 0) { + if (ast_opt_high_priority) + ast_set_priority(0); /* Close file descriptors and launch system command */ for (x = STDERR_FILENO + 1; x < 4096; x++) close(x); diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 260a08c437..33d7e59d67 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -436,6 +436,10 @@ static int spawn_mp3(struct mohclass *class) } if (!class->pid) { int x; + + if (ast_opt_high_priority) + ast_set_priority(0); + close(fds[0]); /* Stdout goes to pipe */ dup2(fds[1], STDOUT_FILENO);