summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2009-11-13 20:42:03 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2009-11-13 20:42:03 +0000
commit5e2aa190fe2e4903bfc72701bb3c9ed1672b9c2f (patch)
tree7999c8a779ea7262d222e1e6ed6905b4feedf795 /include
parent85dd68ca7a4ef7eea76c3fbc85f7beb5fb050bdd (diff)
Display a list of channel variables in each channel-oriented event.
(Closes AST-33) Reviewboard: https://reviewboard.asterisk.org/r/368/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/manager.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/include/asterisk/manager.h b/include/asterisk/manager.h
index 5b83c3ef5..ddfbd3d31 100644
--- a/include/asterisk/manager.h
+++ b/include/asterisk/manager.h
@@ -197,11 +197,26 @@ int astman_verify_session_writepermissions(uint32_t ident, int perm);
/* XXX the parser in gcc 2.95 gets confused if you don't put a space
* between the last arg before VA_ARGS and the comma */
#define manager_event(category, event, contents , ...) \
- __manager_event(category, event, __FILE__, __LINE__, __PRETTY_FUNCTION__, contents , ## __VA_ARGS__)
-
-int __attribute__((format(printf, 6, 7))) __manager_event(int category, const char *event,
- const char *file, int line, const char *func,
- const char *contents, ...);
+ __ast_manager_event_multichan(category, event, 0, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, contents , ## __VA_ARGS__)
+#define ast_manager_event(chan, category, event, contents , ...) \
+ do { \
+ struct ast_channel *_chans[] = { chan, }; \
+ __ast_manager_event_multichan(category, event, 1, _chans, __FILE__, __LINE__, __PRETTY_FUNCTION__, contents , ## __VA_ARGS__); \
+ } while (0)
+#define ast_manager_event_multichan(category, event, nchans, chans, contents , ...) \
+ __ast_manager_event_multichan(category, event, nchans, chans, __FILE__, __LINE__, __PRETTY_FUNCTION__, contents , ## __VA_ARGS__);
+
+/*! External routines may send asterisk manager events this way
+ * \param chan1 First channel related to this event (or NULL if none are relevant)
+ * \param chan2 Second channel related to this event (or NULL if none are relevant)
+ * \param category Event category, matches manager authorization
+ * \param event Event name
+ * \param contents Format string describing event
+ * \since 1.6.3
+*/
+int __ast_manager_event_multichan(int category, const char *event, int chancount,
+ struct ast_channel **chans, const char *file, int line, const char *func,
+ const char *contents, ...) __attribute__((format(printf, 8, 9)));
/*! \brief Get header from mananger transaction */
const char *astman_get_header(const struct message *m, char *var);