<div dir="ltr">Joshua,<div><br></div><div>Maybe this can help (from <a href="https://wiki.freeswitch.org/wiki/Event_Socket#event">https://wiki.freeswitch.org/wiki/Event_Socket#event</a>):</div><div><br></div><div>
<h3> <span class="gmail-mw-headline" id="gmail-Special_Case_-_.27myevents.27"></span></h3>
<h2> <span class="gmail-mw-headline" id="gmail-filter">filter</span></h2>
<p>Specify event types to listen for. Note, this is not a filter out but
rather a "filter in," that is, when a filter is applied only the
filtered values are received. Multiple filters on a socket connection
are allowed.
</p><p>Usage:
</p>
<pre> filter <EventHeader> <ValueToFilter>
</pre>
<p>Example:
</p><p>The following example will subscribe to all events and then
create two filters, one to listen for HEARTBEATS and one to listen for
CHANNEL_EXECUTE events.
</p>
<pre> events plain all
Content-Type: command/reply
Reply-Text: +OK event listener enabled plain
filter Event-Name CHANNEL_EXECUTE
Content-Type: command/reply
Reply-Text: +OK filter added. [filter]=[Event-Name CHANNEL_EXECUTE]
filter Event-Name HEARTBEAT
Content-Type: command/reply
Reply-Text: +OK filter added. [Event-Name]=[HEARTBEAT]
</pre>
<p>Now only HEARTBEAT and CHANNEL_EXECUTE events will be received. You
can filter on any of the event headers. To filter for a specific channel
you will need to use the uuid:
</p>
<pre> filter Unique-ID d29a070f-40ff-43d8-8b9d-d369b2389dfe
</pre>
<p>This method is an alternative to the <a href="https://wiki.freeswitch.org/wiki/Mod_event_socket#Special_Case_-_.27myevents.27" title="Mod event socket">myevents</a> event type. If you need <i>only</i> the events for a specific channel then use <b>myevents</b>, otherwise use a combination of filters to narrow down the events you wish to receive on the socket.
</p><p>To filter multiple unique IDs, you can just add another filter
for events for each UUID. This can be useful for example if you want to
receive start/stop-talking events for multiple users on a particular
conference.
<code>
</code></p><code>
<pre> filter plain all
filter plain CUSTOM conference::maintenance
filter Unique-ID $participantB
filter Unique-ID $participantA
filter Unique-ID $participantC
</pre>
</code><p><code></code>
</p><p>This will give you events for Participant A,B and C on any
conference. To receive events for all users on a conference you can use
something like:
</p><p><code>
filter Conference-Unique-ID $ConfUUID
</code>
</p><p>You can filter on any of the parameters you get in a freeSWITCH event:
</p><p><code>
</code></p><code>
<pre> filter plain all
filter call-direction Inbound
filter Event-Calling-File mod_conference.c
filter Conference-Unique-ID $ConfUUID
</pre>
</code><p><code></code>
</p><p>You can use them individually or compound them depending on
whatever end result you desire for the type of events you want to
receive
</p>
<h2> <span class="gmail-mw-headline" id="gmail-filter_delete">filter delete</span></h2>
<p>Specify the events which you want to revoke the filter. filter delete
can be used when some filters are applied wrongly or when there is no
use of the filter.
</p><p>Usage:
</p>
<pre> filter delete <EventHeader> <ValueToFilter>
</pre>
<p>Example:
</p>
<pre> filter delete Event-Name HEARTBEAT
</pre>
<p>Now, you will no longer receive HEARTBEAT events. You can delete any filter that is applied by this way.
</p>
<pre> filter delete Unique-ID d29a070f-40ff-43d8-8b9d-d369b2389dfe
</pre>
<p>This is to delete the filter which is applied for the given
unique-id. After this, you won't receive any events for this unique-id.
</p>
<pre> filter delete Unique-ID
</pre>
<p>This deletes all the filters which are applied based on the unique-id.
</p>
Regards,</div><div><br></div><div>Guillermo</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 21, 2018 at 2:27 PM, Joshua Gigg <span dir="ltr"><<a href="mailto:giggsey@gmail.com" target="_blank">giggsey@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>We're using the inbound ESL socket to subscribe to certain events. However, we receive these events for every call.</div><div><br></div><div>Is it possible to dynamically subscribe to events per call via the API?</div><div><br></div><div>We're hoping to add/remove certain events at certain points during our call flows to avoid unnecessary noise in the events received.</div></div>
<br>______________________________<wbr>______________________________<wbr>_____________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.<wbr>freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.<wbr>org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.<wbr>freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Guillermo Ruiz Camauer<br></div>
</div>