[asterisk-dev] [Code Review] 0019287: inverse / incorrect behavior for CLI / console logging of DTMF

jrose reviewboard at asterisk.org
Thu Jun 2 13:01:08 CDT 2011



> On 2011-06-01 16:18:41, David Vossel wrote:
> > /branches/1.8/main/asterisk.c, lines 1127-1130
> > <https://reviewboard.asterisk.org/r/1244/diff/1/?file=16807#file16807line1127>
> >
> >     This logically makes sense to me, but I am very confused.  svn blame shows this line has existed this way for years, how has this gone unnoticed?  If this just broke recently I'd like to know what caused it as this isn't the reason.
> 
> jrose wrote:
>     Yes, I was thinking the same thing.  At the same time though, I was looking at this and it seems so obviously wrong that it just seems like it has to be the problem's source.
>     
>     I'll checkout to that revision and see if this is how it's working there.  I imagine it would be very easy for this to go unnoticed though depending on how frequently users actually change the logger settings in CLI.
>     
>     Before I posted it Edit:  I can confirm that as far back as the beginning of 2009 that this behavior has been the reverse of what you would expect with logger set levels ____ on turning logging off and " off turning logging on within the connected console.
>     
>     Since I couldn't get the actual revision in question compiled, but the above came only moderately later and shows the same problems, I'm currently standing by this fix.  I'll try to go back as early as I can though.

Ok, so I finally managed to test this in the revision that this line is blamed for...


JonUbuntu*CLI> logger set level WARNING on
Logger status for 'WARNING' has been set to 'on'.
  == Using SIP RTP CoS mark 5
  == Using UDPTL CoS mark 5
    -- Executing [1001 at sipphones:1] Answer("SIP/evilhost-08d3f688", "") in new stack
    -- Executing [1001 at sipphones:2] Playback("SIP/evilhost-08d3f688", "tt-weasels") in new stack
    -- <SIP/evilhost-08d3f688> Playing 'tt-weasels.gsm' (language 'en')
    -- Executing [1001 at sipphones:3] BackGround("SIP/evilhost-08d3f688", "tt-codezone") in new stack
    -- Executing [1001 at sipphones:4] Hangup("SIP/evilhost-08d3f688", "") in new stack
  == Spawn extension (sipphones, 1001, 4) exited non-zero on 'SIP/evilhost-08d3f688'
logger set level WARNING off
Logger status for 'WARNING' has been set to 'off'.
  == Using SIP RTP CoS mark 5
  == Using UDPTL CoS mark 5
    -- Executing [1001 at sipphones:1] Answer("SIP/evilhost-08d28448", "") in new stack
    -- Executing [1001 at sipphones:2] Playback("SIP/evilhost-08d28448", "tt-weasels") in new stack
    -- <SIP/evilhost-08d28448> Playing 'tt-weasels.gsm' (language 'en')
    -- Executing [1001 at sipphones:3] BackGround("SIP/evilhost-08d28448", "tt-codezone") in new stack
[2011-06-0212:58:30] WARNING[16296]: file.c:582 ast_openstream_full: File tt-codezone does not exist in any format
[2011-06-0212:58:30] WARNING[16296]: file.c:896 ast_streamfile: Unable to open tt-codezone (format 0x2 (gsm)): No such file or directory
[2011-06-0212:58:30] WARNING[16296]: pbx.c:7656 pbx_builtin_background: ast_streamfile failed on SIP/evilhost-08d28448 for tt-codezone
    -- Executing [1001 at sipphones:4] Hangup("SIP/evilhost-08d28448", "") in new stack
  == Spawn extension (sipphones, 1001, 4) exited non-zero on 'SIP/evilhost-08d28448'
JonUbuntu*CLI> 


So as you can see, the logger settings have been reversed all along.

Also, this feature was added in that revision to start with, so that pretty much says it all I guess.


- jrose


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1244/#review3660
-----------------------------------------------------------


On 2011-06-01 15:58:14, jrose wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1244/
> -----------------------------------------------------------
> 
> (Updated 2011-06-01 15:58:14)
> 
> 
> Review request for Asterisk Developers, Russell Bryant and David Vossel.
> 
> 
> Summary
> -------
> 
> ast_network_puts_mutable writes to a connected console client only if it's level was set to false.  This changes that function to write it only if it is set to true to resolve the reverse behavior from expectations issue.
> 
> This seems like the way to go, but I can't see for the life of me why this mistake would be made if it really was just a mistake.  It's hard to say.
> 
> 
> This addresses bug 19287.
>     https://issues.asterisk.org/view.php?id=19287
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/main/asterisk.c 321530 
> 
> Diff: https://reviewboard.asterisk.org/r/1244/diff
> 
> 
> Testing
> -------
> 
> Just tested with a couple of connected clients.  I'll test more tomorrow.
> 
> 
> Thanks,
> 
> jrose
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110602/bb38ade4/attachment.htm>


More information about the asterisk-dev mailing list