diff options
-rwxr-xr-x | asterisk.c | 4 | ||||
-rwxr-xr-x | include/asterisk.h | 2 | ||||
-rwxr-xr-x | res/res_agi.c | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/asterisk.c b/asterisk.c index dedf23e69..fe2861533 100755 --- a/asterisk.c +++ b/asterisk.c @@ -674,7 +674,7 @@ static void set_icon(char *text) fprintf(stdout, "\033]1;%s\007", text); } -static int set_priority(int pri) +int ast_set_priority(int pri) { struct sched_param sched; memset(&sched, 0, sizeof(sched)); @@ -1940,7 +1940,7 @@ int main(int argc, char *argv[]) ast_verbose("[ Reading Master Configuration ]"); ast_readconfig(); - if (set_priority(option_highpriority)) { + if (ast_set_priority(option_highpriority)) { exit(1); } diff --git a/include/asterisk.h b/include/asterisk.h index 708d503a4..e10200bbd 100755 --- a/include/asterisk.h +++ b/include/asterisk.h @@ -37,6 +37,8 @@ extern char ast_config_AST_CTL_OWNER[AST_CONFIG_MAX_PATH]; extern char ast_config_AST_CTL_GROUP[AST_CONFIG_MAX_PATH]; extern char ast_config_AST_CTL[AST_CONFIG_MAX_PATH]; +/* Provided by asterisk.c */ +extern int ast_set_priority(int); /* Provided by module.c */ extern int load_modules(const int preload_only); /* Provided by pbx.c */ diff --git a/res/res_agi.c b/res/res_agi.c index 9dd62fba7..89b25e762 100755 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -279,6 +279,9 @@ static int launch_script(char *script, char *argv[], int *fds, int *efd, int *op for (x=STDERR_FILENO + 2;x<1024;x++) close(x); + /* Don't run AGI scripts with realtime priority -- it causes audio stutter */ + ast_set_priority(0); + /* Execute script */ execv(script, argv); /* Can't use ast_log since FD's are closed */ |