]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_misdn: Fix misdn debug output printed with arbitrary verbose levels.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 4 Sep 2013 16:16:55 +0000 (16:16 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 4 Sep 2013 16:16:55 +0000 (16:16 +0000)
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
........

Merged revisions 398236 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@398240 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_misdn.c

index c0ded431702bfcb7784dd8b8269a758ff3ba4467..39144288d3eb450623506bdf8789564628ca1f3a 100644 (file)
@@ -12762,8 +12762,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)) {
@@ -12775,12 +12774,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;
                }