[asterisk-commits] rmudgett: trunk r313629 - in /trunk: ./ res/res_agi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Apr 13 12:21:53 CDT 2011


Author: rmudgett
Date: Wed Apr 13 12:21:50 2011
New Revision: 313629

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=313629
Log:
Merged revisions 313615 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r313615 | rmudgett | 2011-04-13 12:18:49 -0500 (Wed, 13 Apr 2011) | 5 lines
  
  * Add missing channel lock to handle_cli_agi_add_cmd().
  
  * Flush any Async AGI commands left over from earlier Async AGI control of
  the call.
........

Modified:
    trunk/   (props changed)
    trunk/res/res_agi.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/res/res_agi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_agi.c?view=diff&rev=313629&r1=313628&r2=313629
==============================================================================
--- trunk/res/res_agi.c (original)
+++ trunk/res/res_agi.c Wed Apr 13 12:21:50 2011
@@ -1115,6 +1115,8 @@
 		return CLI_FAILURE;
 	}
 
+	ast_channel_lock(chan);
+
 	if (add_agi_cmd(chan, a->argv[3], (a->argc > 4 ? a->argv[4] : ""))) {
 		ast_log(LOG_WARNING, "failed to add AGI command to queue of channel %s\n", chan->name);
 		ast_channel_unlock(chan);
@@ -1219,6 +1221,11 @@
 	if (add_to_agi(chan)) {
 		ast_log(LOG_ERROR, "failed to start Async AGI on channel %s\n", chan->name);
 		return AGI_RESULT_FAILURE;
+	}
+
+	/* Flush any stale commands. */
+	while ((cmd = get_agi_cmd(chan))) {
+		free_agi_cmd(cmd);
 	}
 
 	/* this pipe allows us to create a "fake" AGI struct to use




More information about the asterisk-commits mailing list