<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 13, 2018 at 2:27 PM Kevin Harwell <<a href="mailto:kharwell@digium.com">kharwell@digium.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">
<p style="margin-bottom:0in;line-height:100%">Greetings,</p>
<p style="margin-bottom:0in;line-height:100%">I'm looking into
adding the ability for an ARI application to dynamically control
which event types it would like sent to it[1] (i.e. server side event
type filtering). I'm currently leaning toward implementing this as a
blacklist. I believe doing so would ease the development burden on
the Asterisk side as well as on the application side of things while
maintaining current application received event type expectations. Here's a proposed
REST interface:</p>
<p style="margin-bottom:0in;line-height:100%">GET
/applications/{applicationName}/excludeEventFilters</p></div></blockquote><div>.</div><div>excludeEventFilters sounds like you're excluding event filters. What you're operating on is an eventExclusionList</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="margin-bottom:0in;line-height:100%"> Returns a list of
exclude event filters.</p>
<p style="margin-bottom:0in;line-height:100%">POST
/applications/{applicationName}/excludeEventFilters<br></p>
<p style="margin-bottom:0in;line-height:100%"> Using a json
object as a body parameter create a list of exclude event filters. This will overwrite any existing filters list. For now the json
object *might* look something like the following:<br></p>
<p style="margin-bottom:0in;line-height:100%">{ types: [
eventType, eventType, ...] }</p></div></blockquote><div><br></div><div>When you POST, you're asking the object to take some action.</div><div>If you want to use POST, then the json blob should contain an "add" list of types and a "remove" list of types. </div><div><br></div><div>We SHOULD be using PUT to add or replace an entire list.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">
<p style="margin-bottom:0in;line-height:100%">By making it an
object this would make it possible to add more filtering in the
future without having to update the definition.<br></p>
<p style="margin-bottom:0in;line-height:100%">DELETE
/applications/{applicationName}/excludeEventFilters<br></p>
<p style="margin-bottom:0in;line-height:100%"> Remove all
filters from the exclude list.<br></p></div></blockquote><div><br></div><div>DELETE deletes the list. See below.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="margin-bottom:0in;line-height:100%">If people wanted I
could also add the following?<br></p>
<p style="margin-bottom:0in;line-height:100%">PUT
/applications/{applicationName}/excludeEventFilters/{eventType}<br></p>
<p style="margin-bottom:0in;line-height:100%"> Add the specified
“eventType” to the exclude list.<br></p>
<p style="margin-bottom:0in;line-height:100%">DELETE
/applications/{applicationName}/excludeEventFilters/{eventType}<br></p>
<p style="margin-bottom:0in;line-height:100%"> Remove the
specified “eventType” from the exclude list.<br></p></div></blockquote><div><br></div><div>You could DELETE /applications/{applicationName}/eventExclusionList/all</div><div>to delete the event types from the list.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="margin-bottom:0in;line-height:100%"></p>
<p style="margin-bottom:0in;line-height:100%">Naming is hard, but
I've used “exclude” in order to signify that matches on a
specified filter would block messages being sent to the application.
“Filters” I've used because it's filtering the messages that are
being sent to the application, and later we might want to filter off
more than the event type name.<br></p>
<p style="margin-bottom:0in;line-height:100%">Anyhoo thoughts,
opinions, alternative ideas are most welcome.<br></p>
<p style="margin-bottom:0in;line-height:100%">Thanks!<br></p>
<p style="margin-bottom:0in;line-height:100%">[1]
<a href="https://issues.asterisk.org/jira/browse/ASTERISK-28106" target="_blank">https://issues.asterisk.org/jira/browse/ASTERISK-28106</a><br></p><div><br></div>-- <br><div dir="ltr" class="gmail-m_5135784970696870613gmail_signature"><div dir="ltr">Kevin Harwell<div>Digium - A Sangoma Company | Senior Software Developer<div>445 Jan Davis Drive NW - Huntsville, AL 35806 - US</div><div>Check us out at: <a href="https://digium.com" target="_blank">https://digium.com</a> & <a href="https://asterisk.org" target="_blank">https://asterisk.org</a></div></div></div></div></div>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr" style="font-size:12.8px"><b style="font-family:arial,helvetica,sans-serif;font-size:12.8px">George Joseph</b><br></div><div dir="ltr"><div style="font-size:12.8px"><font face="arial, helvetica, sans-serif" size="1">Digium - A Sangoma Company | Software Developer | Software Engineering</font></div><font size="1">445 Jan Davis Drive NW - Huntsville, AL 35806 - US</font></div><div dir="ltr"><font size="1">direct/fax: +1 256 428 6012</font><div style="font-size:12.8px"><font face="arial, helvetica, sans-serif" size="1">Check us out at: <a href="https://digium.com/" style="color:rgb(17,85,204)" target="_blank">https://digium.com</a> · <a href="https://sangoma.com/" style="color:rgb(17,85,204)" target="_blank">https://sangoma.com</a></font></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><img src="https://www.digium.com/sites/digium/themes/digium/logo.png" width="96" height="60"></div></div></div></div></div></div></div>