diff options
author | Luigi Rizzo <rizzo@icir.org> | 2006-11-03 18:53:26 +0000 |
---|---|---|
committer | Luigi Rizzo <rizzo@icir.org> | 2006-11-03 18:53:26 +0000 |
commit | 0bf4235ff19000fc6d8b17059187c94088dda9c6 (patch) | |
tree | 04ed5d0fa33ec0abc3bb77ba77e1c4ceb7b74233 /include | |
parent | 4a545a76626d6aedc0b2d742afae0210dc15e0d2 (diff) |
add a new cli/manager.conf option "debug" to enable/disable
debugging code in the manager.
At the moment the debugging code is very lightweight, if the option
is enabled manager messages also carry a sequence number and
the info where they have been generated e.g.
SequenceNumber: 10
File: chan_sip.c
Line: 11927
Func: handle_response_register
It is not worthwhile having this as a compile time option
right now, because the extra work involved at runtime is
just checking one variable.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/manager.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/asterisk/manager.h b/include/asterisk/manager.h index 68c2fed2d..6a44ab912 100644 --- a/include/asterisk/manager.h +++ b/include/asterisk/manager.h @@ -111,8 +111,14 @@ int ast_manager_unregister( char *action ); \param event Event name \param contents Contents of event */ -int manager_event(int category, const char *event, const char *contents, ...) - __attribute__ ((format (printf, 3,4))); +/* 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 __manager_event(int category, const char *event, + const char *file, int line, const char *func, const char *contents, ...) + __attribute__ ((format (printf, 6,7))); /*! Get header from mananger transaction */ char *astman_get_header(struct message *m, char *var); |