[asterisk-bugs] [Asterisk 0019287]: inverse / incorrect behavior for CLI / console logging of DTMF

Asterisk Bug Tracker noreply at bugs.digium.com
Fri May 13 09:08:14 CDT 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=19287 
====================================================================== 
Reported By:                luckman212
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   19287
Category:                   Core/Configuration
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     acknowledged
Asterisk Version:           1.8.4 
JIRA:                       SWP-3468 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): 1.8 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2011-05-12 23:54 CDT
Last Modified:              2011-05-13 09:08 CDT
====================================================================== 
Summary:                    inverse / incorrect behavior for CLI / console
logging of DTMF
Description: 
try this:

set /etc/asterisk/logger.conf as so:
[general]
dateformat=%F %T

[logfiles]
messages => notice,warning,error
full => dtmf,notice,warning,error,debug,verbose
console => dtmf,notice,warning,error


Now, start Asterisk CLI and try to play some DTMF tones, you won't see
them logged to the console (but they ARE logged to /var/log/asterisk/full)

now,
type 'logger set level DTMF off'   (yes, OFF)

and test again, now DTMF is being logged to console! 
so it seems the switch is somehow 'backwards'
====================================================================== 

---------------------------------------------------------------------- 
 (0134893) lmadsen (administrator) - 2011-05-13 09:08
 https://issues.asterisk.org/view.php?id=19287#c134893 
---------------------------------------------------------------------- 
Yes I realize that, I just happened to be testing on trunk.

Here is a conversation on IRC. I have a fix, but it's not the right "fix".
I'll come back to this when I have time. If I have time :)

<leifmadsen> http://pastebin.ca/2058239
<leifmadsen> when I change that line, it works as expected
<leifmadsen> it seems like it should have been right in the first place
though
<russellb> i don't know the context
<leifmadsen> argv[4] would be 'on' or 'off'
<leifmadsen> logger set level DTMF on
<leifmadsen> right now... on == off, and off == on
<russellb> then ast_true() doesn't make any sense, i didn't know how it
took "on"
<leifmadsen> right
<russellb> oh, it does.
<leifmadsen> I just don't know if it's flipping it because of on ==
<something that evals to false>
<russellb> but yes, it looks right before the change
<russellb> check how toggle_loglevel() works
<russellb> and how it handles the state argument
<leifmadsen> ast_console_toggle_loglevel() ?
<russellb> yes
<russellb> what is it doing when given state == 1 vs state == 0
<leifmadsen> only time it deals with state is assigning it to:  
consoles[x].levels[level] = state;
<leifmadsen> like here:  http://pastebin.ca/2058244
<leifmadsen> I don't understand enough to know what it is doing there
<russellb> so what tells you it's broken in the first place
<pabelanger> leifmadsen: space between 0 and ;
<leifmadsen> russellb: well just using it :)
<pabelanger> err, ; and x
<leifmadsen> when I use 'on' it turns it off, and vice-versa
<leifmadsen> pabelanger: oh ya? let me try that..........
<pabelanger> leifmadsen: not the fix, just code formatting :p
<leifmadsen> oh well eff that ;)
<leifmadsen> anyways, it's not immediately obvious why it's broken, so I'm
going to move onto releases
<russellb> k!
<leifmadsen> I was hoping to fix something trivial but it's not that way
:)
<leifmadsen> it does work opposite of what I expected, and was confused
why flipping the ast_true() around worked because that seemed wrong
<russellb> the next thing to look at is how consoles[].levels[] values are
read
<russellb> well i believe that your change fixes it
<leifmadsen> it does
<russellb> i just think the fix should be to make the code work how we
think it should work
<leifmadsen> but I don't think it's the right fix....
<russellb> right
<leifmadsen> I think it's the hack
<russellb> something is reading levels backwards 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-05-13 09:08 lmadsen        Note Added: 0134893                          
======================================================================




More information about the asterisk-bugs mailing list