From d79ae049b3f418cb0a4341d026a2f8e871279b4c Mon Sep 17 00:00:00 2001 From: Walter Doekes Date: Tue, 21 Jan 2014 21:05:11 +0000 Subject: [PATCH] manager: Clarify eventfilter documentation. Textual changes only. Review: https://reviewboard.asterisk.org/r/3133/ ........ Merged revisions 406079 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@406080 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- configs/manager.conf.sample | 13 +++++++------ main/manager.c | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/configs/manager.conf.sample b/configs/manager.conf.sample index 54f6928c86..e5e2962ea0 100644 --- a/configs/manager.conf.sample +++ b/configs/manager.conf.sample @@ -94,12 +94,13 @@ bindaddr = 0.0.0.0 ; user. ; ;eventfilter=Event: Newchannel -;eventfilter=!Channel: DAHDI* -; The eventfilter option is used to whitelist or blacklist events per user to be -; reported with regular expressions and are allowed if both the regex matches -; and the user has read access set below. Filters are assumed to be for whitelisting -; unless preceeded by an exclamation point, which marks it as being black. -; Evaluation of the filters is as follows: +;eventfilter=!Channel: DAHDI.* +; The eventfilter option is used to whitelist or blacklist events per user. +; A filter consists of a (basic/old-style and unanchored) regular expression +; that is run on the entire event data. If the first character of the filter +; is an exclamation mark (!), the filter is appended to the blacklist instead +; of the whitelist. After first checking the read access below, the regular +; expression filters are processed as follows: ; - If no filters are configured all events are reported as normal. ; - If there are white filters only: implied black all filter processed first, ; then white filters. diff --git a/main/manager.c b/main/manager.c index 890aeee7f0..b7e75c33ba 100644 --- a/main/manager.c +++ b/main/manager.c @@ -4772,8 +4772,8 @@ static enum add_filter_result manager_add_filter(const char *filter_pattern, str is_blackfilter = 0; } - if (regcomp(new_filter, filter_pattern, 0)) { - ao2_t_ref(new_filter, -1, "failed to make regx"); + if (regcomp(new_filter, filter_pattern, 0)) { /* XXX: the only place we use non-REG_EXTENDED */ + ao2_t_ref(new_filter, -1, "failed to make regex"); return FILTER_COMPILE_FAIL; }