Configuring filters
Filters are used to decide which calls to process and which to ignore. The following list explains the parameters that determine what to do with the conditions that are specified in a filter configuration:
-
negate
— The default value ofnegate
isfalse
.-
When set to
false
, the expressions in the filter are assessed together and all specified conditions must match with the call audio's metadata to pass the filter. -
When set to
true
, specified conditions must not match with call audio's metadata to pass the filter.
-
-
strict
— The default value ofstrict
istrue
.-
When
strict = true
, calls do not pass the filter unless the call audio's metadata contains key-value pairs that meet the defined conditions. -
When
strict = false
, filter conditions are ignored if a key-value pair in the call's metadata is missing for the specified condition.
-
The filter parameter in the
[MyHandler]
sample below calls on the
[PittsburghOutboundCalls]
,
[PittsburghOutboundCallsLoose]
,
[NotPittsburghOrOutboundCalls]
, and
[NotPittsburghOrOutboundCallsLoose]
filter configurations:
[MyHandler]
filter = PittsburghOutboundCalls, PittsburghOutboundCallsLoose], NotPittsburghOrOutboundCalls, NotPittsburghOrOutboundCallsLoose
The values defined in the sample above call on the filter configurations defined separately as shown in the samples below:
[PittsburghOutboundCalls]
filter = EventFilter
negate = false
strict = true
# Conditions:
remoteparty = ^412|^878|^724
direction = ^out$
The
[PittsburghOutboundCalls]
configuration processes calls that meet the following conditions:
-
negate = false
— All specified conditions must match with the call audio's metadata to pass the filter. -
strict = true
— All specified conditions must be met for the call to pass the filter. Calls that do not contain metadata with the key-value pairs specified in the conditions will not process. -
remoteparty = ^412|^878|^724
— Only calls containing metadata whereremoteparty
has area codes of 412, 878, and 724 will pass the filter. -
direction = ^out$
— Only calls containing metadata wheredirection
is outbound will pass the filter.
[PittsburghOutboundCallsLoose]
filter = EventFilter
negate = false
strict = false
# Conditions:
remoteparty = ^412|^878|^724
direction = ^out$
The
[PittsburghOutboundCallsLoose]
configuration processes calls that meet the following conditions:
-
negate = false
— All specified conditions must match with the call audio's metadata to pass the filter. -
strict = false
— Ignores the specified filter condition if it's key-value pair is missing from the call audio's metadata. -
remoteparty = ^412|^878|^724
— Calls containing metadata with area codes of 412, 878, and 724 will pass the filter; However, becausestrict = false
, calls that do not containremoteparty
metadata (or a missing value) will also pass the filter. -
direction = ^out$
— Outbound calls will pass the filter; however, becausestrict = false
, calls that do not containdirection
metadata (or a missing value) will also pass the filter.
[NotPittsburghOrOutboundCalls]
Filter = EventFilter
negate = true
strict = true
# Conditions:
remoteparty = ^412|^878|^724
direction = ^out$
The
[NotPittsburghOrOutboundCalls]
configuration processes calls that meet the following conditions:
-
negate = true
— Specified conditions must not match with call audio metadata for the call to pass the filter. -
strict = true
— All specified conditions must be met for the call to pass the filter. Calls that do not contain metadata with the key-value pairs specified in the conditions will not process. -
remoteparty = ^412|^878|^724
— Calls containing metadata with area codes of 412, 878, and 724 will not pass the filter. Calls only process if the metadata has aremoteparty
value that does not match 412, 878, or 724. -
direction = ^out$
— Only calls containing metadata wheredirection
is not outbound will pass the filter.
[NotPittsburghOrOutboundCallsLoose]
Filter = EventFilter
negate = true
strict = false
# Conditions:
remoteparty = ^412|^878|^724
direction = ^out$
The
[NotPittsburghOrOutboundCallsLoose]
configuration processes calls that meet the following conditions:
-
negate = true
— Specified conditions must not match with call audio metadata for the call to pass the filter. -
strict = false
— Ignores filter conditions if key-value pairs are missing from the call audio's metadata. -
remoteparty = ^412|^878|^724
— Calls containing metadata with area codes of 412, 878, and 724 will not pass the filter. Calls will process if the metadata has aremoteparty
value that does not match 412, 878, or 724; in addition, becausestrict = false
, calls that do not containremoteparty
metadata (or a missing value) will also pass the filter. -
direction = ^out$
— The call will only pass the filter if call direction is not outbound; however, becausestrict = false
, calls that do not containdirection
metadata or a missing value will also pass the filter.
The following table includes a sample list of filter conditions that vary depending on the telephony system in use:
Parameter |
Description |
---|---|
captureport |
Port that captured the call. |
direction |
Either
|
duration |
The duration of the call in seconds at the time the event fires. |
filename |
The filename of the audio file for the call, relative to
|
hostname |
The hostname of the server hosting
|
localip |
The IP address for the local party. |
localparty |
The phone number for the local party (inside the network). |
nativecallid |
Internal call ID. Example: 71dfc843b8e5e97172875d3d52785924010@10.155.12.185. |
recid |
Unique ID assigned to this call. |
remoteip |
The IP address for the remote party of the call. |
remoteparty |
The phone number for the remote party (outside the network). |
service |
The name of the recorder service. |
stage |
Either start (call begins), stop (call ended) or ready (audio file available). |
timestamp |
Timestamp dated at the start of the call. |