summaryrefslogtreecommitdiff
path: root/apps/app_agi.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-05-22 04:52:50 +0000
committerMark Spencer <markster@digium.com>2004-05-22 04:52:50 +0000
commit47133fda31483f9365648758f09e1c647c4a2979 (patch)
treefb7c67035e750b56e1423e904d34dcfde9ce2d33 /apps/app_agi.c
parenta0486afb833b715fad3b31833bd7d2348f5fe6e1 (diff)
Work on a copy with app_agi
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_agi.c')
-rwxr-xr-xapps/app_agi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/app_agi.c b/apps/app_agi.c
index d7af708b4..ef8436325 100755
--- a/apps/app_agi.c
+++ b/apps/app_agi.c
@@ -1466,7 +1466,8 @@ static int agi_exec_full(struct ast_channel *chan, void *data, int enhanced, int
int res=0;
struct localuser *u;
char *argv[MAX_ARGS];
- char *tmp = (char *)data;
+ char buf[2048]="";
+ char *tmp = (char *)buf;
int argc = 0;
int fds[2];
int efd = -1;
@@ -1477,7 +1478,7 @@ static int agi_exec_full(struct ast_channel *chan, void *data, int enhanced, int
ast_log(LOG_WARNING, "AGI requires an argument (script)\n");
return -1;
}
-
+ strncpy(buf, data, sizeof(buf) - 1);
memset(&agi, 0, sizeof(agi));
while ((stringp = strsep(&tmp, "|"))) {
@@ -1500,7 +1501,7 @@ static int agi_exec_full(struct ast_channel *chan, void *data, int enhanced, int
agi.fd = fds[1];
agi.ctrl = fds[0];
agi.audio = efd;
- res = run_agi(chan, tmp, &agi, pid, dead);
+ res = run_agi(chan, argv[0], &agi, pid, dead);
close(fds[1]);
if (efd > -1)
close(efd);