aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_agi.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-21 05:22:18 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-21 05:22:18 +0000
commit8b09090fc140885813db6e0f568f854143570230 (patch)
tree7ee1c68a908cca545178b76205c25e9b1af9f9cd /res/res_agi.c
parent72e3856804d44a8c03b6820d01d8c6c4e48143be (diff)
Bug 4872 - Make Asterisk paths available to AGIs via environmental variables
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8372 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_agi.c')
-rw-r--r--res/res_agi.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index 29a4c8fbb..d7f0574af 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -272,6 +272,18 @@ static int launch_script(char *script, char *argv[], int *fds, int *efd, int *op
return -1;
}
if (!pid) {
+ /* Pass paths to AGI via environmental variables */
+ setenv("AST_CONFIG_DIR", ast_config_AST_CONFIG_DIR, 1);
+ setenv("AST_CONFIG_FILE", ast_config_AST_CONFIG_FILE, 1);
+ setenv("AST_MODULE_DIR", ast_config_AST_MODULE_DIR, 1);
+ setenv("AST_SPOOL_DIR", ast_config_AST_SPOOL_DIR, 1);
+ setenv("AST_MONITOR_DIR", ast_config_AST_MONITOR_DIR, 1);
+ setenv("AST_VAR_DIR", ast_config_AST_VAR_DIR, 1);
+ setenv("AST_LOG_DIR", ast_config_AST_LOG_DIR, 1);
+ setenv("AST_AGI_DIR", ast_config_AST_AGI_DIR, 1);
+ setenv("AST_KEY_DIR", ast_config_AST_KEY_DIR, 1);
+ setenv("AST_RUN_DIR", ast_config_AST_RUN_DIR, 1);
+
/* Redirect stdin and out, provide enhanced audio channel if desired */
dup2(fromast[0], STDIN_FILENO);
dup2(toast[1], STDOUT_FILENO);