summaryrefslogtreecommitdiff
path: root/res/res_agi.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2006-01-21 05:22:18 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2006-01-21 05:22:18 +0000
commit0f2a9df6aab0055a8307437e41bf54d98c150891 (patch)
tree7ee1c68a908cca545178b76205c25e9b1af9f9cd /res/res_agi.c
parente3e7e1d1b2d470427a1c6fa5f8f15b80c9bd0a5f (diff)
Bug 4872 - Make Asterisk paths available to AGIs via environmental variables
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8372 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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);