Author: gtjoseph
Date: Sat Aug 30 12:24:57 2014
New Revision: 422443

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=422443
Log:
manager: Make WaitEvent action respect eventfilters

A WaitEvent issued via an http session isn't respecting eventfilters defined
for the user. I just added a match_filter to the predicate that controls
astman_append.

Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3958/
........

Merged revisions 422439 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 422440 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 422441 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 422442 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    trunk/   (props changed)
    trunk/main/manager.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/main/manager.c
URL: 
http://svnview.digium.com/svn/asterisk/trunk/main/manager.c?view=diff&rev=422443&r1=422442&r2=422443
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Sat Aug 30 12:24:57 2014
@@ -1372,6 +1372,8 @@
 static AO2_GLOBAL_OBJ_STATIC(event_docs);
 
 static enum add_filter_result manager_add_filter(const char *filter_pattern, 
struct ao2_container *whitefilters, struct ao2_container *blackfilters);
+
+static int match_filter(struct mansession *s, char *eventdata);
 
 /*!
  * @{ \brief Define AMI message types.
@@ -3593,8 +3595,9 @@
                struct eventqent *eqe = s->session->last_ev;
                astman_send_response(s, m, "Success", "Waiting for Event 
completed.");
                while ((eqe = advance_event(eqe))) {
-                       if (((s->session->readperm & eqe->category) == 
eqe->category) &&
-                           ((s->session->send_events & eqe->category) == 
eqe->category)) {
+                       if (((s->session->readperm & eqe->category) == 
eqe->category)
+                               && ((s->session->send_events & eqe->category) 
== eqe->category)
+                               && match_filter(s, eqe->eventdata)) {
                                astman_append(s, "%s", eqe->eventdata);
                        }
                        s->session->last_ev = eqe;


-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to