From a89916022e2d680380614b340f98f7bc5e81c890 Mon Sep 17 00:00:00 2001 From: Chris Tooley Date: Mon, 16 Jun 2008 17:29:06 +0000 Subject: [PATCH] Fixes and closes bug number 12804 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@123075 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_externalivr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c index 7c9be392ca..687ed68eb6 100644 --- a/apps/app_externalivr.c +++ b/apps/app_externalivr.c @@ -304,7 +304,7 @@ static int app_exec(struct ast_channel *chan, void *data) int res = -1; int gen_active = 0; int pid; - char *buf, *pipe_delim_argbuf, *pdargbuf_ptr; + char *buf, *comma_delim_argbuf; struct ivr_localuser foo = { .playlist = AST_LIST_HEAD_INIT_VALUE, .finishlist = AST_LIST_HEAD_INIT_VALUE, @@ -330,9 +330,7 @@ static int app_exec(struct ast_channel *chan, void *data) AST_STANDARD_APP_ARGS(args, buf); /* copy args and replace commas with pipes */ - pipe_delim_argbuf = ast_strdupa(data); - while((pdargbuf_ptr = strchr(pipe_delim_argbuf, ',')) != NULL) - pdargbuf_ptr[0] = '|'; + comma_delim_argbuf = ast_strdupa(data); if (pipe(child_stdin)) { ast_chan_log(LOG_WARNING, chan, "Could not create pipe for child input: %s\n", strerror(errno)); @@ -388,7 +386,7 @@ static int app_exec(struct ast_channel *chan, void *data) child_stdout[1] = 0; close(child_stderr[1]); child_stderr[1] = 0; - res = eivr_comm(chan, u, child_stdin[1], child_stdout[0], child_stderr[0], pipe_delim_argbuf); + res = eivr_comm(chan, u, child_stdin[1], child_stdout[0], child_stderr[0], comma_delim_argbuf); exit: if (gen_active) @@ -480,7 +478,7 @@ static int eivr_comm(struct ast_channel *chan, struct ivr_localuser *u, errno = 0; exception = 0; - rchan = ast_waitfor_nandfds(&chan, 1, waitfds, 2, &exception, &ready_fd, &ms); + rchan = ast_waitfor_nandfds(&chan, 1, waitfds, (eivr_errors_fd == 0) ? 1 : 2, &exception, &ready_fd, &ms); if (!AST_LIST_EMPTY(&u->finishlist)) { AST_LIST_LOCK(&u->finishlist);