diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c index ef35637c958001b32d3d0a025fdfd3d66045ace5..7a9757ed1bf8d9e85e6515dcd45a057d0d8c511a 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 f06cbaef3f2ed77cd5dd00f1f90de35421ca60ef..223aca571f394c0e87298c9283d9033ec97cf44f 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; x<length; x+=2) diff --git a/apps/app_ices.c b/apps/app_ices.c index 3a8130ab64926358b08f60416d069f5ccf80a6bf..9558f021bb8a32d024d7b261643cf8582800fbf8 100644 --- a/apps/app_ices.c +++ b/apps/app_ices.c @@ -46,6 +46,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/pbx.h" #include "asterisk/module.h" #include "asterisk/translate.h" +#include "asterisk/options.h" #define ICES "/usr/bin/ices" #define LOCAL_ICES "/usr/local/bin/ices" @@ -70,6 +71,8 @@ static int icesencode(char *filename, int fd) ast_log(LOG_WARNING, "Fork failed\n"); if (res) return res; + if (ast_opt_high_priority) + ast_set_priority(0); dup2(fd, STDIN_FILENO); for (x=STDERR_FILENO + 1;x<256;x++) { if ((x != STDIN_FILENO) && (x != STDOUT_FILENO)) diff --git a/apps/app_mp3.c b/apps/app_mp3.c index bfb0eb9ad9c8165ede475bb4f480e749f56d67c9..b5a3138075912ff99b10986a2704a56518e5a49a 100644 --- a/apps/app_mp3.c +++ b/apps/app_mp3.c @@ -45,6 +45,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/pbx.h" #include "asterisk/module.h" #include "asterisk/translate.h" +#include "asterisk/options.h" #define LOCAL_MPG_123 "/usr/local/bin/mpg123" #define MPG_123 "/usr/bin/mpg123" @@ -71,6 +72,8 @@ static int mp3play(char *filename, int fd) ast_log(LOG_WARNING, "Fork failed\n"); if (res) return res; + if (ast_opt_high_priority) + ast_set_priority(0); dup2(fd, STDOUT_FILENO); for (x=0;x<256;x++) { if (x != STDOUT_FILENO) diff --git a/apps/app_nbscat.c b/apps/app_nbscat.c index a557f2dfae25607b63664012f36d68ad1fe21eaf..05fb4e4425e97bb4736cd3f2b18bc4e072069fc0 100644 --- a/apps/app_nbscat.c +++ b/apps/app_nbscat.c @@ -46,6 +46,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/pbx.h" #include "asterisk/module.h" #include "asterisk/translate.h" +#include "asterisk/options.h" #define LOCAL_NBSCAT "/usr/local/bin/nbscat8k" #define NBSCAT "/usr/bin/nbscat8k" @@ -75,6 +76,9 @@ static int NBScatplay(int fd) ast_log(LOG_WARNING, "Fork failed\n"); if (res) return res; + if (ast_opt_high_priority) + ast_set_priority(0); + dup2(fd, STDOUT_FILENO); for (x=0;x<256;x++) { if (x != STDOUT_FILENO) diff --git a/apps/app_zapras.c b/apps/app_zapras.c index c95f7523844357033a704fcd659a2fc06d8b1972..d75d2ee7c754f34f402bb2f934596d8e4f94d0b3 100644 --- a/apps/app_zapras.c +++ b/apps/app_zapras.c @@ -100,6 +100,10 @@ static pid_t spawn_ras(struct ast_channel *chan, char *args) /* Execute RAS on File handles */ dup2(chan->fds[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 db5bf122cefbc4dcc3b7763702d0da9ecf3b7aad..e256d3f07b093115a053cb5fd57c94acfd63c26a 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 260a08c437d7b76777bc119ccaab311de39498a4..33d7e59d6720bf5ae4628693fb5dc351fb04b816 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);