[asterisk-commits] branch 1.2 r33615 - /branches/1.2/res/res_agi.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Jun 12 08:27:18 MST 2006


Author: tilghman
Date: Mon Jun 12 10:27:18 2006
New Revision: 33615

URL: http://svn.digium.com/view/asterisk?rev=33615&view=rev
Log:
Move set priority up, because at this point in the code, stdout is no longer
the console.  If we're unable to set priority, the error goes to Asterisk as
if it were an AGI command (issue 7335).

Modified:
    branches/1.2/res/res_agi.c

Modified: branches/1.2/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/res/res_agi.c?rev=33615&r1=33614&r2=33615&view=diff
==============================================================================
--- branches/1.2/res/res_agi.c (original)
+++ branches/1.2/res/res_agi.c Mon Jun 12 10:27:18 2006
@@ -282,6 +282,9 @@
 		return -1;
 	}
 	if (!pid) {
+		/* Don't run AGI scripts with realtime priority -- it causes audio stutter */
+		ast_set_priority(0);
+
 		/* Redirect stdin and out, provide enhanced audio channel if desired */
 		dup2(fromast[0], STDIN_FILENO);
 		dup2(toast[1], STDOUT_FILENO);
@@ -300,9 +303,6 @@
 		/* Close everything but stdin/out/error */
 		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);



More information about the asterisk-commits mailing list