From: Richard Mudgett Date: Wed, 4 Sep 2013 16:08:02 +0000 (+0000) Subject: chan_misdn: Fix misdn debug output printed with arbitrary verbose levels. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7828d4deada02db15927c3f4f3de1bd39eef3581;p=thirdparty%2Fasterisk.git chan_misdn: Fix misdn debug output printed with arbitrary verbose levels. Fix the misdn debug output to remote consoles. chan_misdn uses ast_console_puts() which doesn't know about verbose levels. Better to use ast_verbose() instead. Without this patch the misdn debug messages are appended to the verbose level which ever was set by the message sent to the console before, i.e. any undefined level. (closes issue AST-1218) Reported by: Guenther Kelleter Patches: misdnlog.patch (license #6372) patch uploaded by Guenther Kelleter ........ Merged revisions 398235 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.15@398239 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c index 63443e2980..4b492e666c 100644 --- a/channels/chan_misdn.c +++ b/channels/chan_misdn.c @@ -12655,8 +12655,7 @@ static void chan_misdn_log(int level, int port, char *tmpl, ...) } else if (misdn_debug_only[port] ? (level == 1 && misdn_debug[port]) || level == misdn_debug[port] : level <= misdn_debug[port]) { - ast_console_puts(port_buf); - ast_console_puts(buf); + ast_verbose("%s%s", port_buf, buf); } if (level <= misdn_debug[0] && !ast_strlen_zero(global_tracefile)) { @@ -12668,12 +12667,7 @@ static void chan_misdn_log(int level, int port, char *tmpl, ...) fp = fopen(global_tracefile, "a+"); if (!fp) { - ast_console_puts("Error opening Tracefile: [ "); - ast_console_puts(global_tracefile); - ast_console_puts(" ] "); - - ast_console_puts(strerror(errno)); - ast_console_puts("\n"); + ast_verbose("Error opening Tracefile: [ %s ] %s\n", global_tracefile, strerror(errno)); return; }