[asterisk-dev] [Code Review] Add regular expression blacklist filtering for manager events
    Russell Bryant 
    russell at digium.com
       
    Fri Jun  4 18:57:45 CDT 2010
    
    
  
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/673/#review2154
-----------------------------------------------------------
/trunk/main/manager.c
<https://reviewboard.asterisk.org/r/673/#comment4602>
    unused variable?
/trunk/main/manager.c
<https://reviewboard.asterisk.org/r/673/#comment4601>
    You can accomplish this with a single ao2_callback().
    
    ao2_callback(container, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, NULL, NULL);
    
    something like that ...
/trunk/main/manager.c
<https://reviewboard.asterisk.org/r/673/#comment4603>
    What is the value of copying all of this instead of just referencing the original container?
/trunk/main/manager.c
<https://reviewboard.asterisk.org/r/673/#comment4604>
    Since you don't actually need a reference to the object, you could do an ao2_callback_data() and pass an additional integer that gets set in the callback on a match, and then use it as your return value.
/trunk/main/manager.c
<https://reviewboard.asterisk.org/r/673/#comment4605>
    Check for allocation failure
- Russell
On 2010-06-03 17:37:30, Jeff Peeler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/673/
> -----------------------------------------------------------
> 
> (Updated 2010-06-03 17:37:30)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> From the submitter:
> to allow better filtering of ami-events than configuring categories, I created an option "eventfilter" for manager-users. Events to be sent are matched against regexes specified in these options and are discarded if the regex matches (blacklisting).
> 
> 
> This addresses bug 14861.
>     https://issues.asterisk.org/view.php?id=14861
> 
> 
> Diffs
> -----
> 
>   /trunk/CHANGES 267758 
>   /trunk/configs/manager.conf.sample 267758 
>   /trunk/main/manager.c 267758 
> 
> Diff: https://reviewboard.asterisk.org/r/673/diff
> 
> 
> Testing
> -------
> 
> I ensured manager events are reported the same without filtering and works as expected with.
> 
> 
> Thanks,
> 
> Jeff
> 
>
    
    
More information about the asterisk-dev
mailing list