[asterisk-commits] mnicholson: branch 1.6.1 r158894 - in /branches/1.6.1: ./ include/asterisk/ m...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 24 16:05:34 CST 2008


Author: mnicholson
Date: Mon Nov 24 16:05:34 2008
New Revision: 158894

URL: http://svn.digium.com/view/asterisk?view=rev&rev=158894
Log:
Merged revisions 158876 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r158876 | mnicholson | 2008-11-24 15:56:22 -0600 (Mon, 24 Nov 2008) | 7 lines
  
  Added EVENT_FLAG_AGI and used it for manager calls in res_agi.c
  
  (closes issue #13873)
  Reported by: fnordian
  Patches:
        ami_agievent.patch uploaded by fnordian (license 110)
........

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/include/asterisk/manager.h
    branches/1.6.1/main/manager.c
    branches/1.6.1/res/res_agi.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/include/asterisk/manager.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.1/include/asterisk/manager.h?view=diff&rev=158894&r1=158893&r2=158894
==============================================================================
--- branches/1.6.1/include/asterisk/manager.h (original)
+++ branches/1.6.1/include/asterisk/manager.h Mon Nov 24 16:05:34 2008
@@ -71,6 +71,7 @@
 #define EVENT_FLAG_CDR			(1 << 10) /* CDR events */
 #define EVENT_FLAG_DIALPLAN		(1 << 11) /* Dialplan events (VarSet, NewExten) */
 #define EVENT_FLAG_ORIGINATE	(1 << 12) /* Originate a call to an extension */
+#define EVENT_FLAG_AGI			(1 << 13) /* AGI events */
 /*@} */
 
 /*! \brief Export manager structures */

Modified: branches/1.6.1/main/manager.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.1/main/manager.c?view=diff&rev=158894&r1=158893&r2=158894
==============================================================================
--- branches/1.6.1/main/manager.c (original)
+++ branches/1.6.1/main/manager.c Mon Nov 24 16:05:34 2008
@@ -336,6 +336,7 @@
 	{ EVENT_FLAG_CDR, "cdr" },
 	{ EVENT_FLAG_DIALPLAN, "dialplan" },
 	{ EVENT_FLAG_ORIGINATE, "originate" },
+	{ EVENT_FLAG_AGI, "agi" },
 	{ -1, "all" },
 	{ 0, "none" },
 };

Modified: branches/1.6.1/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.1/res/res_agi.c?view=diff&rev=158894&r1=158893&r2=158894
==============================================================================
--- branches/1.6.1/res/res_agi.c (original)
+++ branches/1.6.1/res/res_agi.c Mon Nov 24 16:05:34 2008
@@ -431,7 +431,7 @@
 	   care of AGI commands on this channel can decide which AGI commands
 	   to execute based on the setup info */
 	ast_uri_encode(agi_buffer, ami_buffer, AMI_BUF_SIZE, 1);
-	manager_event(EVENT_FLAG_CALL, "AsyncAGI", "SubEvent: Start\r\nChannel: %s\r\nEnv: %s\r\n", chan->name, ami_buffer);
+	manager_event(EVENT_FLAG_AGI, "AsyncAGI", "SubEvent: Start\r\nChannel: %s\r\nEnv: %s\r\n", chan->name, ami_buffer);
 	while (1) {
 		/* bail out if we need to hangup */
 		if (ast_check_hangup(chan)) {
@@ -464,9 +464,9 @@
 			agi_buffer[res] = '\0';
 			ast_uri_encode(agi_buffer, ami_buffer, AMI_BUF_SIZE, 1);
 			if (ast_strlen_zero(cmd->cmd_id))
-				manager_event(EVENT_FLAG_CALL, "AsyncAGI", "SubEvent: Exec\r\nChannel: %s\r\nResult: %s\r\n", chan->name, ami_buffer);
+				manager_event(EVENT_FLAG_AGI, "AsyncAGI", "SubEvent: Exec\r\nChannel: %s\r\nResult: %s\r\n", chan->name, ami_buffer);
 			else
-				manager_event(EVENT_FLAG_CALL, "AsyncAGI", "SubEvent: Exec\r\nChannel: %s\r\nCommandID: %s\r\nResult: %s\r\n", chan->name, cmd->cmd_id, ami_buffer);
+				manager_event(EVENT_FLAG_AGI, "AsyncAGI", "SubEvent: Exec\r\nChannel: %s\r\nCommandID: %s\r\nResult: %s\r\n", chan->name, cmd->cmd_id, ami_buffer);
 			free_agi_cmd(cmd);
 		} else {
 			/* no command so far, wait a bit for a frame to read */
@@ -496,7 +496,7 @@
 quit:
 	/* notify manager users this channel cannot be
 	   controlled anymore by Async AGI */
-	manager_event(EVENT_FLAG_CALL, "AsyncAGI", "SubEvent: End\r\nChannel: %s\r\n", chan->name);
+	manager_event(EVENT_FLAG_AGI, "AsyncAGI", "SubEvent: End\r\nChannel: %s\r\n", chan->name);
 
 	/* close the pipe */
 	close(fds[0]);
@@ -2560,7 +2560,7 @@
 	char *ami_cmd = ast_strdupa(buf);
 	int command_id = ast_random(), resultcode = 200;
 
-	manager_event(EVENT_FLAG_CALL, "AGIExec",
+	manager_event(EVENT_FLAG_AGI, "AGIExec",
 			"SubEvent: Start\r\n"
 			"Channel: %s\r\n"
 			"CommandId: %d\r\n"
@@ -2580,7 +2580,7 @@
 		case RESULT_FAILURE: ami_res = "Failure"; resultcode = -1; break;
 		case RESULT_SUCCESS: ami_res = "Success"; resultcode = 200; break;
 		}
-		manager_event(EVENT_FLAG_CALL, "AGIExec",
+		manager_event(EVENT_FLAG_AGI, "AGIExec",
 				"SubEvent: End\r\n"
 				"Channel: %s\r\n"
 				"CommandId: %d\r\n"
@@ -2604,7 +2604,7 @@
 		}
 	} else if ((c = find_command(argv, 0))) {
 		ast_agi_send(agi->fd, chan, "511 Command Not Permitted on a dead channel\n");
-		manager_event(EVENT_FLAG_CALL, "AGIExec",
+		manager_event(EVENT_FLAG_AGI, "AGIExec",
 				"SubEvent: End\r\n"
 				"Channel: %s\r\n"
 				"CommandId: %d\r\n"
@@ -2613,7 +2613,7 @@
 				"Result: Command not permitted on a dead channel\r\n", chan->name, command_id, ami_cmd);
 	} else {
 		ast_agi_send(agi->fd, chan, "510 Invalid or unknown command\n");
-		manager_event(EVENT_FLAG_CALL, "AGIExec",
+		manager_event(EVENT_FLAG_AGI, "AGIExec",
 				"SubEvent: End\r\n"
 				"Channel: %s\r\n"
 				"CommandId: %d\r\n"
@@ -3052,7 +3052,7 @@
 	(void) ast_agi_register_multiple(ast_module_info->self, commands, ARRAY_LEN(commands));
 	ast_register_application(deadapp, deadagi_exec, deadsynopsis, descrip);
 	ast_register_application(eapp, eagi_exec, esynopsis, descrip);
-	ast_manager_register2("AGI", EVENT_FLAG_CALL, action_add_agi_cmd, "Add an AGI command to execute by Async AGI", mandescr_asyncagi);
+	ast_manager_register2("AGI", EVENT_FLAG_AGI, action_add_agi_cmd, "Add an AGI command to execute by Async AGI", mandescr_asyncagi);
 	return ast_register_application(app, agi_exec, synopsis, descrip);
 }
 




More information about the asterisk-commits mailing list