[asterisk-commits] pabelanger: branch pabelanger/issue17173 r258765 - in /team/pabelanger/issue1...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 23 10:26:47 CDT 2010


Author: pabelanger
Date: Fri Apr 23 10:26:36 2010
New Revision: 258765

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=258765
Log:
Update ast_manager_register2 to include new type parameter, allowing us to now pass MANAGER_ACTION or MANAGER_EVENT.

Modified:
    team/pabelanger/issue17173/apps/app_mixmonitor.c
    team/pabelanger/issue17173/apps/app_queue.c
    team/pabelanger/issue17173/apps/app_senddtmf.c
    team/pabelanger/issue17173/apps/app_voicemail.c
    team/pabelanger/issue17173/channels/chan_agent.c
    team/pabelanger/issue17173/channels/chan_iax2.c
    team/pabelanger/issue17173/channels/chan_sip.c
    team/pabelanger/issue17173/channels/chan_skinny.c
    team/pabelanger/issue17173/include/asterisk/manager.h
    team/pabelanger/issue17173/main/data.c
    team/pabelanger/issue17173/main/db.c
    team/pabelanger/issue17173/main/features.c
    team/pabelanger/issue17173/main/manager.c
    team/pabelanger/issue17173/main/pbx.c
    team/pabelanger/issue17173/res/res_agi.c
    team/pabelanger/issue17173/res/res_monitor.c
    team/pabelanger/issue17173/res/res_mutestream.c

Modified: team/pabelanger/issue17173/apps/app_mixmonitor.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/apps/app_mixmonitor.c?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/apps/app_mixmonitor.c (original)
+++ team/pabelanger/issue17173/apps/app_mixmonitor.c Fri Apr 23 10:26:36 2010
@@ -717,7 +717,7 @@
 	ast_cli_register_multiple(cli_mixmonitor, ARRAY_LEN(cli_mixmonitor));
 	res = ast_register_application_xml(app, mixmonitor_exec);
 	res |= ast_register_application_xml(stop_app, stop_mixmonitor_exec);
-	res |= ast_manager_register_xml("MixMonitorMute", 0, manager_mute_mixmonitor);
+	res |= ast_manager_register_xml(MANAGER_ACTION, "MixMonitorMute", 0, manager_mute_mixmonitor);
 
 	return res;
 }

Modified: team/pabelanger/issue17173/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/apps/app_queue.c?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/apps/app_queue.c (original)
+++ team/pabelanger/issue17173/apps/app_queue.c Fri Apr 23 10:26:36 2010
@@ -7977,17 +7977,17 @@
 	res |= ast_register_application_xml(app_pqm, pqm_exec);
 	res |= ast_register_application_xml(app_upqm, upqm_exec);
 	res |= ast_register_application_xml(app_ql, ql_exec);
-	res |= ast_manager_register_xml("Queues", 0, manager_queues_show);
-	res |= ast_manager_register_xml("QueueStatus", 0, manager_queues_status);
-	res |= ast_manager_register_xml("QueueSummary", 0, manager_queues_summary);
-	res |= ast_manager_register_xml("QueueAdd", EVENT_FLAG_AGENT, manager_add_queue_member);
-	res |= ast_manager_register_xml("QueueRemove", EVENT_FLAG_AGENT, manager_remove_queue_member);
-	res |= ast_manager_register_xml("QueuePause", EVENT_FLAG_AGENT, manager_pause_queue_member);
-	res |= ast_manager_register_xml("QueueLog", EVENT_FLAG_AGENT, manager_queue_log_custom);
-	res |= ast_manager_register_xml("QueuePenalty", EVENT_FLAG_AGENT, manager_queue_member_penalty);
-	res |= ast_manager_register_xml("QueueRule", 0, manager_queue_rule_show);
-	res |= ast_manager_register_xml("QueueReload", 0, manager_queue_reload);
-	res |= ast_manager_register_xml("QueueReset", 0, manager_queue_reset);
+	res |= ast_manager_register_xml(MANAGER_ACTION, "Queues", 0, manager_queues_show);
+	res |= ast_manager_register_xml(MANAGER_ACTION, "QueueStatus", 0, manager_queues_status);
+	res |= ast_manager_register_xml(MANAGER_ACTION, "QueueSummary", 0, manager_queues_summary);
+	res |= ast_manager_register_xml(MANAGER_ACTION, "QueueAdd", EVENT_FLAG_AGENT, manager_add_queue_member);
+	res |= ast_manager_register_xml(MANAGER_ACTION, "QueueRemove", EVENT_FLAG_AGENT, manager_remove_queue_member);
+	res |= ast_manager_register_xml(MANAGER_ACTION, "QueuePause", EVENT_FLAG_AGENT, manager_pause_queue_member);
+	res |= ast_manager_register_xml(MANAGER_ACTION, "QueueLog", EVENT_FLAG_AGENT, manager_queue_log_custom);
+	res |= ast_manager_register_xml(MANAGER_ACTION, "QueuePenalty", EVENT_FLAG_AGENT, manager_queue_member_penalty);
+	res |= ast_manager_register_xml(MANAGER_ACTION, "QueueRule", 0, manager_queue_rule_show);
+	res |= ast_manager_register_xml(MANAGER_ACTION, "QueueReload", 0, manager_queue_reload);
+	res |= ast_manager_register_xml(MANAGER_ACTION, "QueueReset", 0, manager_queue_reset);
 	res |= ast_custom_function_register(&queuevar_function);
 	res |= ast_custom_function_register(&queuemembercount_function);
 	res |= ast_custom_function_register(&queuemembercount_dep);

Modified: team/pabelanger/issue17173/apps/app_senddtmf.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/apps/app_senddtmf.c?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/apps/app_senddtmf.c (original)
+++ team/pabelanger/issue17173/apps/app_senddtmf.c Fri Apr 23 10:26:36 2010
@@ -150,7 +150,7 @@
 {
 	int res;
 
-	res = ast_manager_register_xml("PlayDTMF", EVENT_FLAG_CALL, manager_play_dtmf);
+	res = ast_manager_register_xml(MANAGER_ACTION, "PlayDTMF", EVENT_FLAG_CALL, manager_play_dtmf);
 	res |= ast_register_application_xml(app, senddtmf_exec);
 
 	return res;

Modified: team/pabelanger/issue17173/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/apps/app_voicemail.c?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/apps/app_voicemail.c (original)
+++ team/pabelanger/issue17173/apps/app_voicemail.c Fri Apr 23 10:26:36 2010
@@ -12490,7 +12490,7 @@
 	res |= ast_register_application_xml(app4, vmauthenticate);
 	res |= ast_register_application_xml(sayname_app, vmsayname_exec);
 	res |= ast_custom_function_register(&mailbox_exists_acf);
-	res |= ast_manager_register_xml("VoicemailUsersList", EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, manager_list_voicemail_users);
+	res |= ast_manager_register_xml(MANAGER_ACTION, "VoicemailUsersList", EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, manager_list_voicemail_users);
 #ifdef TEST_FRAMEWORK
 	res |= AST_TEST_REGISTER(test_voicemail_vmsayname);
 	res |= AST_TEST_REGISTER(test_voicemail_msgcount);

Modified: team/pabelanger/issue17173/channels/chan_agent.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/channels/chan_agent.c?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/channels/chan_agent.c (original)
+++ team/pabelanger/issue17173/channels/chan_agent.c Fri Apr 23 10:26:36 2010
@@ -2328,8 +2328,8 @@
 	ast_register_application_xml(app3, agentmonitoroutgoing_exec);
 
 	/* Manager commands */
-	ast_manager_register_xml("Agents", EVENT_FLAG_AGENT, action_agents);
-	ast_manager_register_xml("AgentLogoff", EVENT_FLAG_AGENT, action_agent_logoff);
+	ast_manager_register_xml(MANAGER_ACTION, "Agents", EVENT_FLAG_AGENT, action_agents);
+	ast_manager_register_xml(MANAGER_ACTION, "AgentLogoff", EVENT_FLAG_AGENT, action_agent_logoff);
 
 	/* CLI Commands */
 	ast_cli_register_multiple(cli_agents, ARRAY_LEN(cli_agents));

Modified: team/pabelanger/issue17173/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/channels/chan_iax2.c?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/channels/chan_iax2.c (original)
+++ team/pabelanger/issue17173/channels/chan_iax2.c Fri Apr 23 10:26:36 2010
@@ -14037,10 +14037,10 @@
 
 	ast_register_application_xml(papp, iax2_prov_app);
 	
-	ast_manager_register_xml("IAXpeers", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_peers);
-	ast_manager_register_xml("IAXpeerlist", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_peer_list);
-	ast_manager_register_xml("IAXnetstats", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_netstats);
-	ast_manager_register_xml("IAXregistry", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_registry);
+	ast_manager_register_xml(MANAGER_ACTION, "IAXpeers", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_peers);
+	ast_manager_register_xml(MANAGER_ACTION, "IAXpeerlist", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_peer_list);
+	ast_manager_register_xml(MANAGER_ACTION, "IAXnetstats", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_netstats);
+	ast_manager_register_xml(MANAGER_ACTION, "IAXregistry", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_registry);
 
 	if ((timer = ast_timer_open())) {
 		ast_timer_set_rate(timer, trunkfreq);

Modified: team/pabelanger/issue17173/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/channels/chan_sip.c?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/channels/chan_sip.c (original)
+++ team/pabelanger/issue17173/channels/chan_sip.c Fri Apr 23 10:26:36 2010
@@ -27118,11 +27118,11 @@
 	ast_custom_function_register(&checksipdomain_function);
 
 	/* Register manager commands */
-	ast_manager_register_xml("SIPpeers", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_sip_show_peers);
-	ast_manager_register_xml("SIPshowpeer", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_sip_show_peer);
-	ast_manager_register_xml("SIPqualifypeer", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_sip_qualify_peer);
-	ast_manager_register_xml("SIPshowregistry", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_show_registry);
-	ast_manager_register_xml("SIPnotify", EVENT_FLAG_SYSTEM, manager_sipnotify);
+	ast_manager_register_xml(MANAGER_ACTION, "SIPpeers", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_sip_show_peers);
+	ast_manager_register_xml(MANAGER_ACTION, "SIPshowpeer", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_sip_show_peer);
+	ast_manager_register_xml(MANAGER_ACTION, "SIPqualifypeer", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_sip_qualify_peer);
+	ast_manager_register_xml(MANAGER_ACTION, "SIPshowregistry", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_show_registry);
+	ast_manager_register_xml(MANAGER_ACTION, "SIPnotify", EVENT_FLAG_SYSTEM, manager_sipnotify);
 	sip_poke_all_peers();	
 	sip_send_all_registers();
 	sip_send_all_mwi_subscriptions();

Modified: team/pabelanger/issue17173/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/channels/chan_skinny.c?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/channels/chan_skinny.c (original)
+++ team/pabelanger/issue17173/channels/chan_skinny.c Fri Apr 23 10:26:36 2010
@@ -7327,10 +7327,10 @@
 	ast_rtp_glue_register(&skinny_rtp_glue);
 	ast_cli_register_multiple(cli_skinny, ARRAY_LEN(cli_skinny));
 
-	ast_manager_register_xml("SKINNYdevices", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_skinny_show_devices);
-	ast_manager_register_xml("SKINNYshowdevice", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_skinny_show_device);
-	ast_manager_register_xml("SKINNYlines", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_skinny_show_lines);
-	ast_manager_register_xml("SKINNYshowline", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_skinny_show_line);
+	ast_manager_register_xml(MANAGER_ACTION, "SKINNYdevices", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_skinny_show_devices);
+	ast_manager_register_xml(MANAGER_ACTION, "SKINNYshowdevice", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_skinny_show_device);
+	ast_manager_register_xml(MANAGER_ACTION, "SKINNYlines", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_skinny_show_lines);
+	ast_manager_register_xml(MANAGER_ACTION, "SKINNYshowline", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_skinny_show_line);
 
 	sched = sched_context_create();
 	if (!sched) {

Modified: team/pabelanger/issue17173/include/asterisk/manager.h
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/include/asterisk/manager.h?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/include/asterisk/manager.h (original)
+++ team/pabelanger/issue17173/include/asterisk/manager.h Fri Apr 23 10:26:36 2010
@@ -79,10 +79,13 @@
 #define EVENT_FLAG_REPORTING		(1 << 9) /* Reporting events such as rtcp sent */
 #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_ORIGINATE		(1 << 12) /* Originate a call to an extension */
 #define EVENT_FLAG_AGI			(1 << 13) /* AGI events */
 #define EVENT_FLAG_HOOKRESPONSE		(1 << 14) /* Hook Response */
 #define EVENT_FLAG_CC			(1 << 15) /* Call Completion events */
+
+#define MANAGER_EVENT			(1 << 16) /* Manager Interface Event */
+#define MANAGER_ACTION			(1 << 17) /* Manager Interface Action */
 /*@} */
 
 /*! \brief Export manager structures */
@@ -155,10 +158,10 @@
 
 /*! \brief External routines may register/unregister manager callbacks this way 
  * \note  Use ast_manager_register2() to register with help text for new manager commands */
-#define ast_manager_register(a, b, c, d) ast_manager_register2(a, b, c, d, NULL)
+#define ast_manager_register(a, b, c, d, e) ast_manager_register2(a, b, c, d, e, NULL)
 
 /*! \brief Register a manager callback using XML documentation to describe the manager. */
-#define ast_manager_register_xml(a, b, c) ast_manager_register2(a, b, c, NULL, NULL)
+#define ast_manager_register_xml(a, b, c, d) ast_manager_register2(a, b, c, d, NULL, NULL)
 
 /*! \brief Register a manager command with the manager interface 
  	\param action Name of the requested Action:
@@ -168,6 +171,7 @@
 	\param description Help text, several lines
 */
 int ast_manager_register2(
+	int type,
 	const char *action,
 	int authority,
 	int (*func)(struct mansession *s, const struct message *m),

Modified: team/pabelanger/issue17173/main/data.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/main/data.c?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/main/data.c (original)
+++ team/pabelanger/issue17173/main/data.c Fri Apr 23 10:26:36 2010
@@ -2869,7 +2869,7 @@
 
 	res |= ast_cli_register_multiple(cli_data, ARRAY_LEN(cli_data));
 
-	res |= ast_manager_register_xml("DataGet", 0, manager_data_get);
+	res |= ast_manager_register_xml(MANAGER_ACTION, "DataGet", 0, manager_data_get);
 
 #ifdef TEST_FRAMEWORK
 	AST_TEST_REGISTER(test_data_get);

Modified: team/pabelanger/issue17173/main/db.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/main/db.c?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/main/db.c (original)
+++ team/pabelanger/issue17173/main/db.c Fri Apr 23 10:26:36 2010
@@ -718,9 +718,9 @@
 {
 	dbinit();
 	ast_cli_register_multiple(cli_database, ARRAY_LEN(cli_database));
-	ast_manager_register_xml("DBGet", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_dbget);
-	ast_manager_register_xml("DBPut", EVENT_FLAG_SYSTEM, manager_dbput);
-	ast_manager_register_xml("DBDel", EVENT_FLAG_SYSTEM, manager_dbdel);
-	ast_manager_register_xml("DBDelTree", EVENT_FLAG_SYSTEM, manager_dbdeltree);
+	ast_manager_register_xml(MANAGER_ACTION, "DBGet", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_dbget);
+	ast_manager_register_xml(MANAGER_ACTION, "DBPut", EVENT_FLAG_SYSTEM, manager_dbput);
+	ast_manager_register_xml(MANAGER_ACTION, "DBDel", EVENT_FLAG_SYSTEM, manager_dbdel);
+	ast_manager_register_xml(MANAGER_ACTION, "DBDelTree", EVENT_FLAG_SYSTEM, manager_dbdeltree);
 	return 0;
 }

Modified: team/pabelanger/issue17173/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/main/features.c?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/main/features.c (original)
+++ team/pabelanger/issue17173/main/features.c Fri Apr 23 10:26:36 2010
@@ -5442,9 +5442,9 @@
 	if (!res)
 		res = ast_register_application2(parkcall, park_call_exec, NULL, NULL, NULL);
 	if (!res) {
-		ast_manager_register_xml("ParkedCalls", 0, manager_parking_status);
-		ast_manager_register_xml("Park", EVENT_FLAG_CALL, manager_park);
-		ast_manager_register_xml("Bridge", EVENT_FLAG_CALL, action_bridge);
+		ast_manager_register_xml(MANAGER_ACTION, "ParkedCalls", 0, manager_parking_status);
+		ast_manager_register_xml(MANAGER_ACTION, "Park", EVENT_FLAG_CALL, manager_park);
+		ast_manager_register_xml(MANAGER_ACTION, "Bridge", EVENT_FLAG_CALL, action_bridge);
 	}
 
 	res |= ast_devstate_prov_add("Park", metermaidstate);

Modified: team/pabelanger/issue17173/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/main/manager.c?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/main/manager.c (original)
+++ team/pabelanger/issue17173/main/manager.c Fri Apr 23 10:26:36 2010
@@ -4455,7 +4455,7 @@
 
 /*! \brief register a new command with manager, including online help. This is
 	the preferred way to register a manager command */
-int ast_manager_register2(const char *action, int auth, int (*func)(struct mansession *s, const struct message *m), const char *synopsis, const char *description)
+int ast_manager_register2(int type, const char *action, int auth, int (*func)(struct mansession *s, const struct message *m), const char *synopsis, const char *description)
 {
 	struct manager_action *cur = NULL;
 #ifdef AST_XML_DOCS
@@ -5575,38 +5575,39 @@
 
 	if (!registered) {
 		/* Register default actions */
-		ast_manager_register_xml("Ping", 0, action_ping);
-		ast_manager_register_xml("Events", 0, action_events);
-		ast_manager_register_xml("Logoff", 0, action_logoff);
-		ast_manager_register_xml("Login", 0, action_login);
-		ast_manager_register_xml("Challenge", 0, action_challenge);
-		ast_manager_register_xml("Hangup", EVENT_FLAG_SYSTEM | EVENT_FLAG_CALL, action_hangup);
-		ast_manager_register_xml("Status", EVENT_FLAG_SYSTEM | EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, action_status);
-		ast_manager_register_xml("Setvar", EVENT_FLAG_CALL, action_setvar);
-		ast_manager_register_xml("Getvar", EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, action_getvar);
-		ast_manager_register_xml("GetConfig", EVENT_FLAG_SYSTEM | EVENT_FLAG_CONFIG, action_getconfig);
-		ast_manager_register_xml("GetConfigJSON", EVENT_FLAG_SYSTEM | EVENT_FLAG_CONFIG, action_getconfigjson);
-		ast_manager_register_xml("UpdateConfig", EVENT_FLAG_CONFIG, action_updateconfig);
-		ast_manager_register_xml("CreateConfig", EVENT_FLAG_CONFIG, action_createconfig);
-		ast_manager_register_xml("ListCategories", EVENT_FLAG_CONFIG, action_listcategories);
-		ast_manager_register_xml("Redirect", EVENT_FLAG_CALL, action_redirect);
-		ast_manager_register_xml("Atxfer", EVENT_FLAG_CALL, action_atxfer);
-		ast_manager_register_xml("Originate", EVENT_FLAG_ORIGINATE, action_originate);
-		ast_manager_register_xml("Command", EVENT_FLAG_COMMAND, action_command);
-		ast_manager_register_xml("ExtensionState", EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, action_extensionstate);
-		ast_manager_register_xml("AbsoluteTimeout", EVENT_FLAG_SYSTEM | EVENT_FLAG_CALL, action_timeout);
-		ast_manager_register_xml("MailboxStatus", EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, action_mailboxstatus);
-		ast_manager_register_xml("MailboxCount", EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, action_mailboxcount);
-		ast_manager_register_xml("ListCommands", 0, action_listcommands);
-		ast_manager_register_xml("SendText", EVENT_FLAG_CALL, action_sendtext);
-		ast_manager_register_xml("UserEvent", EVENT_FLAG_USER, action_userevent);
-		ast_manager_register_xml("WaitEvent", 0, action_waitevent);
-		ast_manager_register_xml("CoreSettings", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, action_coresettings);
-		ast_manager_register_xml("CoreStatus", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, action_corestatus);
-		ast_manager_register_xml("Reload", EVENT_FLAG_CONFIG | EVENT_FLAG_SYSTEM, action_reload);
-		ast_manager_register_xml("CoreShowChannels", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, action_coreshowchannels);
-		ast_manager_register_xml("ModuleLoad", EVENT_FLAG_SYSTEM, manager_moduleload);
-		ast_manager_register_xml("ModuleCheck", EVENT_FLAG_SYSTEM, manager_modulecheck);
+		ast_manager_register_xml(MANAGER_ACTION, "Ping", 0, action_ping);
+		ast_manager_register_xml(MANAGER_ACTION, "Events", 0, action_events);
+		ast_manager_register_xml(MANAGER_ACTION, "Logoff", 0, action_logoff);
+		ast_manager_register_xml(MANAGER_ACTION, "Login", 0, action_login);
+		ast_manager_register_xml(MANAGER_ACTION, "Challenge", 0, action_challenge);
+		ast_manager_register_xml(MANAGER_ACTION, "Hangup", EVENT_FLAG_SYSTEM | EVENT_FLAG_CALL, action_hangup);
+		ast_manager_register_xml(MANAGER_ACTION, "Status", EVENT_FLAG_SYSTEM | EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, action_status);
+		ast_manager_register_xml(MANAGER_ACTION, "Setvar", EVENT_FLAG_CALL, action_setvar);
+		ast_manager_register_xml(MANAGER_ACTION, "Getvar", EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, action_getvar);
+		ast_manager_register_xml(MANAGER_ACTION, "GetConfig", EVENT_FLAG_SYSTEM | EVENT_FLAG_CONFIG, action_getconfig);
+		ast_manager_register_xml(MANAGER_ACTION, "GetConfigJSON", EVENT_FLAG_SYSTEM | EVENT_FLAG_CONFIG, action_getconfigjson);
+		ast_manager_register_xml(MANAGER_ACTION, "UpdateConfig", EVENT_FLAG_CONFIG, action_updateconfig);
+		ast_manager_register_xml(MANAGER_ACTION, "CreateConfig", EVENT_FLAG_CONFIG, action_createconfig);
+		ast_manager_register_xml(MANAGER_ACTION, "ListCategories", EVENT_FLAG_CONFIG, action_listcategories);
+		ast_manager_register_xml(MANAGER_ACTION, "Redirect", EVENT_FLAG_CALL, action_redirect);
+		ast_manager_register_xml(MANAGER_ACTION, "Atxfer", EVENT_FLAG_CALL, action_atxfer);
+		ast_manager_register_xml(MANAGER_ACTION, "Originate", EVENT_FLAG_ORIGINATE, action_originate);
+		ast_manager_register_xml(MANAGER_ACTION, "Command", EVENT_FLAG_COMMAND, action_command);
+		ast_manager_register_xml(MANAGER_ACTION, "ExtensionState", EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, action_extensionstate);
+		ast_manager_register_xml(MANAGER_ACTION, "AbsoluteTimeout", EVENT_FLAG_SYSTEM | EVENT_FLAG_CALL, action_timeout);
+		ast_manager_register_xml(MANAGER_ACTION, "MailboxStatus", EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, action_mailboxstatus);
+		ast_manager_register_xml(MANAGER_ACTION, "MailboxCount", EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, action_mailboxcount);
+		ast_manager_register_xml(MANAGER_ACTION, "ListCommands", 0, action_listcommands);
+		ast_manager_register_xml(MANAGER_ACTION, "SendText", EVENT_FLAG_CALL, action_sendtext);
+		ast_manager_register_xml(MANAGER_ACTION, "UserEvent", EVENT_FLAG_USER, action_userevent);
+		ast_manager_register_xml(MANAGER_ACTION, "WaitEvent", 0, action_waitevent);
+		ast_manager_register_xml(MANAGER_ACTION, "CoreSettings", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, action_coresettings);
+		ast_manager_register_xml(MANAGER_ACTION, "CoreStatus", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, action_corestatus);
+		ast_manager_register_xml(MANAGER_ACTION, "Reload", EVENT_FLAG_CONFIG | EVENT_FLAG_SYSTEM, action_reload);
+		ast_manager_register_xml(MANAGER_ACTION, "CoreShowChannels", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, action_coreshowchannels);
+		ast_manager_register_xml(MANAGER_ACTION, "ModuleLoad", EVENT_FLAG_SYSTEM, manager_moduleload);
+		ast_manager_register_xml(MANAGER_ACTION, "ModuleCheck", EVENT_FLAG_SYSTEM, manager_modulecheck);
+		ast_manager_register_xml(MANAGER_ACTION, "AgentComplete",EVENT_FLAG_SYSTEM, action_ping);
 
 		ast_cli_register_multiple(cli_manager, ARRAY_LEN(cli_manager));
 		ast_extension_state_add(NULL, NULL, manager_state_cb, NULL);

Modified: team/pabelanger/issue17173/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/main/pbx.c?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/main/pbx.c (original)
+++ team/pabelanger/issue17173/main/pbx.c Fri Apr 23 10:26:36 2010
@@ -9730,7 +9730,7 @@
 	}
 
 	/* Register manager application */
-	ast_manager_register_xml("ShowDialPlan", EVENT_FLAG_CONFIG | EVENT_FLAG_REPORTING, manager_show_dialplan);
+	ast_manager_register_xml(MANAGER_ACTION, "ShowDialPlan", EVENT_FLAG_CONFIG | EVENT_FLAG_REPORTING, manager_show_dialplan);
 
 	if (!(device_state_sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE, device_state_cb, "pbx Device State Change", NULL,
 			AST_EVENT_IE_END))) {

Modified: team/pabelanger/issue17173/res/res_agi.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/res/res_agi.c?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/res/res_agi.c (original)
+++ team/pabelanger/issue17173/res/res_agi.c Fri Apr 23 10:26:36 2010
@@ -3837,7 +3837,7 @@
 	(void) ast_agi_register_multiple(ast_module_info->self, commands, ARRAY_LEN(commands));
 	ast_register_application_xml(deadapp, deadagi_exec);
 	ast_register_application_xml(eapp, eagi_exec);
-	ast_manager_register_xml("AGI", EVENT_FLAG_AGI, action_add_agi_cmd);
+	ast_manager_register_xml(MANAGER_ACTION, "AGI", EVENT_FLAG_AGI, action_add_agi_cmd);
 	AST_TEST_REGISTER(test_agi_null_docs);
 	return ast_register_application_xml(app, agi_exec);
 }

Modified: team/pabelanger/issue17173/res/res_monitor.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/res/res_monitor.c?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/res/res_monitor.c (original)
+++ team/pabelanger/issue17173/res/res_monitor.c Fri Apr 23 10:26:36 2010
@@ -902,11 +902,11 @@
 	ast_register_application_xml("ChangeMonitor", change_monitor_exec);
 	ast_register_application_xml("PauseMonitor", pause_monitor_exec);
 	ast_register_application_xml("UnpauseMonitor", unpause_monitor_exec);
-	ast_manager_register_xml("Monitor", EVENT_FLAG_CALL, start_monitor_action);
-	ast_manager_register_xml("StopMonitor", EVENT_FLAG_CALL, stop_monitor_action);
-	ast_manager_register_xml("ChangeMonitor", EVENT_FLAG_CALL, change_monitor_action);
-	ast_manager_register_xml("PauseMonitor", EVENT_FLAG_CALL, pause_monitor_action);
-	ast_manager_register_xml("UnpauseMonitor", EVENT_FLAG_CALL, unpause_monitor_action);
+	ast_manager_register_xml(MANAGER_ACTION, "Monitor", EVENT_FLAG_CALL, start_monitor_action);
+	ast_manager_register_xml(MANAGER_ACTION, "StopMonitor", EVENT_FLAG_CALL, stop_monitor_action);
+	ast_manager_register_xml(MANAGER_ACTION, "ChangeMonitor", EVENT_FLAG_CALL, change_monitor_action);
+	ast_manager_register_xml(MANAGER_ACTION, "PauseMonitor", EVENT_FLAG_CALL, pause_monitor_action);
+	ast_manager_register_xml(MANAGER_ACTION, "UnpauseMonitor", EVENT_FLAG_CALL, unpause_monitor_action);
 
 	return AST_MODULE_LOAD_SUCCESS;
 }

Modified: team/pabelanger/issue17173/res/res_mutestream.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/res/res_mutestream.c?view=diff&rev=258765&r1=258764&r2=258765
==============================================================================
--- team/pabelanger/issue17173/res/res_mutestream.c (original)
+++ team/pabelanger/issue17173/res/res_mutestream.c Fri Apr 23 10:26:36 2010
@@ -83,8 +83,36 @@
 			</para>
 		</description>
 	</function>
+	<manager name="MuteAudio" language="en_US">
+		<synopsis>
+			Mute an incoming or outbound audio stream in a channel.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Channel" required="true">
+				<para>The channel name to mute.</para>
+			</parameter>
+			<parameter name="Direction" required="true">
+				<para>The stream to mute.</para>
+				<enumlist>
+					<enum name="in" />
+					<enum name="out" />
+					<enum name="all" />
+				</enumlist>
+			</parameter>
+			<parameter name="State" required="true">
+				<para>Whether to turn mute on or off..</para>
+				<enumlist>
+					<enum name="on" />
+					<enum name="off" />
+				</enumlist>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Mute an incoming or outbound audio stream in a channel.</para>
+		</description>
+	</manager>
  ***/
-
 
 /*! Our own datastore */
 struct mute_information {
@@ -314,23 +342,12 @@
 	return 0;
 }
 
-
-static const char mandescr_mutestream[] =
-"Description: Mute an incoming or outbound audio stream in a channel.\n"
-"Variables: \n"
-"  Channel: <name>           The channel you want to mute.\n"
-"  Direction: in | out |all  The stream you want to mute.\n"
-"  State: on | off           Whether to turn mute on or off.\n"
-"  ActionID: <id>            Optional action ID for this AMI transaction.\n";
-
-
 static int load_module(void)
 {
 	int res;
 	res = ast_custom_function_register(&mute_function);
 
-	res |= ast_manager_register2("MuteAudio", EVENT_FLAG_SYSTEM, manager_mutestream,
-                        "Mute an audio stream", mandescr_mutestream);
+	res |= ast_manager_register_xml(MANAGER_ACTION, "MuteAudio", EVENT_FLAG_SYSTEM, manager_mutestream);
 
 	return (res ? AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS);
 }
@@ -339,7 +356,7 @@
 {
 	ast_custom_function_unregister(&mute_function);
 	/* Unregister AMI actions */
-        ast_manager_unregister("MuteAudio");
+        ast_manager_unregister("MUTEAUDIO");
 
 	return 0;
 }




More information about the asterisk-commits mailing list