[asterisk-commits] kmoore: trunk r391271 - /trunk/res/res_agi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 10 11:03:53 CDT 2013


Author: kmoore
Date: Mon Jun 10 11:03:51 2013
New Revision: 391271

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=391271
Log:
Add AGI command arguments to AsyncAGI event

This makes the AGI AsyncAGI event put provided AGI command arguments in
the event's environment.

(closes issue ASTERISK-21304)
Patch-By: Dirk Wendland

Modified:
    trunk/res/res_agi.c

Modified: trunk/res/res_agi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_agi.c?view=diff&rev=391271&r1=391270&r2=391271
==============================================================================
--- trunk/res/res_agi.c (original)
+++ trunk/res/res_agi.c Mon Jun 10 11:03:51 2013
@@ -1371,7 +1371,7 @@
 	return AGI_RESULT_SUCCESS;
 }
 
-static enum agi_result launch_asyncagi(struct ast_channel *chan, char *argv[], int *efd)
+static enum agi_result launch_asyncagi(struct ast_channel *chan, int argc, char *argv[], int *efd)
 {
 /* This buffer sizes might cause truncation if the AGI command writes more data
    than AGI_BUF_SIZE as result. But let's be serious, is there an AGI command
@@ -1438,7 +1438,7 @@
 
 	/* notify possible manager users of a new channel ready to
 	   receive commands */
-	setup_env(chan, "async", fds[1], 0, 0, NULL);
+	setup_env(chan, "async", fds[1], 0, argc, argv);
 	/* read the environment */
 	res = read(fds[0], agi_buffer, AGI_BUF_SIZE);
 	if (res <= 0) {
@@ -1794,7 +1794,7 @@
 	return AGI_RESULT_FAILURE;
 }
 
-static enum agi_result launch_script(struct ast_channel *chan, char *script, char *argv[], int *fds, int *efd, int *opid)
+static enum agi_result launch_script(struct ast_channel *chan, char *script, int argc, char *argv[], int *fds, int *efd, int *opid)
 {
 	char tmp[256];
 	int pid, toast[2], fromast[2], audio[2], res;
@@ -1807,7 +1807,7 @@
 		return (efd == NULL) ? launch_ha_netscript(script, argv, fds) : AGI_RESULT_FAILURE;
 	}
 	if (!strncasecmp(script, "agi:async", sizeof("agi:async") - 1)) {
-		return launch_asyncagi(chan, argv, efd);
+		return launch_asyncagi(chan, argc, argv, efd);
 	}
 
 	if (script[0] != '/') {
@@ -4110,7 +4110,7 @@
 			return -1;
 	}
 #endif
-	res = launch_script(chan, args.argv[0], args.argv, fds, enhanced ? &efd : NULL, &pid);
+	res = launch_script(chan, args.argv[0], args.argc, args.argv, fds, enhanced ? &efd : NULL, &pid);
 	/* Async AGI do not require run_agi(), so just proceed if normal AGI
 	   or Fast AGI are setup with success. */
 	if (res == AGI_RESULT_SUCCESS || res == AGI_RESULT_SUCCESS_FAST) {




More information about the asterisk-commits mailing list