Patch:chan_lcr logging in asterisk
"Peter Holik" <[email protected]>
| Newsgroups | gmane.linux.isdn.i4l.user |
|---|---|
| Message-ID | <14ea0bc04b1f231f236eb4f653f4ed95.squirrel@webmail.it-technology.at> |
Hi! With this patches i see loggings in asterisk cli by enable debugging with core set debug 1 cu Peter _______________________________________________ isdn4linux mailing list [email protected] https://www.isdn4linux.de/mailman/listinfo/isdn4linux
chan_lcr.h.logging.diff
(text/x-diff, 743 B)
--- chan_lcr.h.orig 2013-10-29 11:46:33.118212999 +0100 +++ chan_lcr.h 2013-10-29 11:44:06.948353520 +0100 @@ -135,7 +135,7 @@ #define SOCKET_RETRY_TIMER 5 #define CERROR(call, ast, arg...) chan_lcr_log(__LOG_ERROR, __FILE__, __LINE__, __FUNCTION__, call, ast, ##arg) -#define CDEBUG(call, ast, arg...) chan_lcr_log(__LOG_NOTICE, __FILE__, __LINE__, __FUNCTION__, call, ast, ##arg) +#define CDEBUG(call, ast, arg...) chan_lcr_log(__LOG_DEBUG, __FILE__, __LINE__, __FUNCTION__, call, ast, ##arg) void chan_lcr_log(int type, const char *file, int line, const char *function, struct chan_call *call, struct ast_channel *ast, const char *fmt, ...); extern unsigned char flip_bits[256]; void lcr_in_dtmf(struct chan_call *call, int val);
chan_lcr.c.logging.diff
(text/x-diff, 702 B)
--- chan_lcr.c.orig 2013-10-29 11:46:42.005839650 +0100
+++ chan_lcr.c 2013-10-29 11:43:57.972730598 +0100
@@ -238,6 +238,8 @@
char ast_text[128] = "NULL";
va_list args;
+ if (!option_debug) return;
+
ast_mutex_lock(&log_lock);
va_start(args,fmt);
@@ -255,8 +257,8 @@
#endif
ast_text[sizeof(ast_text)-1] = '\0';
-// ast_log(type, file, line, function, "[call=%s ast=%s] %s", call_text, ast_text, buffer);
- printf("[call=%s ast=%s line=%d] %s", call_text, ast_text, line, buffer);
+ ast_log(type, file, line, function, "[call=%s ast=%s] %s", call_text, ast_text, buffer);
+// printf("[call=%s ast=%s line=%d] %s", call_text, ast_text, line, buffer);
ast_mutex_unlock(&log_lock);
}