summaryrefslogtreecommitdiff
path: root/include/asterisk/manager.h
diff options
context:
space:
mode:
authorDavid Brooks <dbrooks@digium.com>2009-11-03 21:26:28 +0000
committerDavid Brooks <dbrooks@digium.com>2009-11-03 21:26:28 +0000
commitd87006ca1c2a6dee92782ea832783a90df21c00e (patch)
treecfb6fb023f534e938a1b28056f5a32a9f4417953 /include/asterisk/manager.h
parent7ed425ec808f26cc02068c81b4b0f28801100b9f (diff)
AMI hook interface
This patch, originally submitted by jozza, enables custom modules to send actions to AMI and receive messages from AMI via a hook interface. Included is a simple test module to illustrate the interface. (closes issue #14635) Reported by: jozza Review: https://reviewboard.asterisk.org/r/412/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/manager.h')
-rw-r--r--include/asterisk/manager.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/asterisk/manager.h b/include/asterisk/manager.h
index 33eb52c04..5b83c3ef5 100644
--- a/include/asterisk/manager.h
+++ b/include/asterisk/manager.h
@@ -73,6 +73,7 @@
#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 */
+#define EVENT_FLAG_HOOKRESPONSE (1 << 14) /* Hook Response */
/*@} */
/*! \brief Export manager structures */
@@ -107,6 +108,15 @@ void ast_manager_register_hook(struct manager_custom_hook *hook);
*/
void ast_manager_unregister_hook(struct manager_custom_hook *hook);
+/*! \brief Registered hooks can call this function to invoke actions and they will receive responses through registered callback
+ * \param hookid the file identifier specified in manager_custom_hook struct when registering a hook
+ * \param msg ami action mesage string e.g. "Action: SipPeers\r\n"
+
+ * \retval 0 on Success
+ * \retval non-zero on Failure
+*/
+int ast_hook_send_action(struct manager_custom_hook *hook, const char *msg);
+
struct mansession;
struct message {