From: Jeff Peeler Date: Fri, 4 Feb 2011 22:37:11 +0000 (+0000) Subject: Send manager event for blackfilter only if it DOES NOT match. X-Git-Tag: 11.0.0-beta1~1875 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d667d7c0faf05e6452a7a1658bf64efa312abf9;p=thirdparty%2Fasterisk.git Send manager event for blackfilter only if it DOES NOT match. The logic got reversed, oops. Works properly now when multiple blackfilters are present. (closes issue #18283) Reported by: telecos82 Patches: ast_managereventfilter.patch uploaded by telecos82 (license 687) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306432 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/manager.c b/main/manager.c index 8efc11d718..599dbca6d1 100644 --- a/main/manager.c +++ b/main/manager.c @@ -4069,11 +4069,12 @@ static int blackfilter_cmp_fn(void *obj, void *arg, void *data, int flags) const char *eventdata = arg; int *result = data; - if (regexec(regex_filter, eventdata, 0, NULL, 0)) { - *result = 1; + if (!regexec(regex_filter, eventdata, 0, NULL, 0)) { + *result = 0; return (CMP_MATCH | CMP_STOP); } + *result = 1; return 0; }