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
This commit is contained in:
Luigi Rizzo
2006-11-03 18:53:26 +00:00
parent 4a545a7662
commit 0bf4235ff1
2 changed files with 36 additions and 7 deletions

View File

@@ -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);