From 0bf4235ff19000fc6d8b17059187c94088dda9c6 Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Fri, 3 Nov 2006 18:53:26 +0000 Subject: 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 --- include/asterisk/manager.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include') 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); -- cgit v1.2.3