The SAFRActions.config file defines which events will trigger specified actions. You can also specify additional condition constraints before the action(s) will trigger. It also contains basic configuration information so that ARES can communicate with other SAFR components, such as the Event Archive.
{
environment : "string",
<optional,
- values: "LOCAL", "DEV", "INT2", "PROD", "Custom"
- if not specified assumed PROD >
eventServer : "string",
<optional,
- required in case of Custom environment
- only affects Custom environment>
replyServer : "string",
<optional,
- only affects Custom environment>
coviServer : "string",
<optional,
- only affects Custom environment>
reportServer : "string",
<optional,
- only affects Custom environment>
configServer : "string",
<optional, "https://cvos.int2.real.com" for
partner cloud environment
"https:\/\/cvos.real.com" for
cloud environment
- if specified config is retrieved from the cloud using the
following address: <configServer>/obj/ares/<aresId> >
userId : "string", <optional>
userPwd : "string", <optional>
directory : "string", <required>
site : "string", <optional>
source : "string", <optional>
aresId : "string", <optional>
maxEventLatency: <long>, <optional, in milliseconds, default = 8000>
rules: [
{
event : {
type: [ "string", ... , "string" ],
<optional, values=(person, badge, action or object), default = all>
personType: [ "string", ... , "string" ],
<optional, default = all, "" = no personType>
personTags: [
[ "string", ... , "string" ],
...
[ "string", ... , "string" ]
]
<optional, default = all>
tagType: [ "string", ... , "string" ]
<optional, values=(april), default = all, "" = no tagType>
tagId: [ "string", ... , "string" ],
<optional, values=(Ids of tagType) default = all, "" = no tagId>
actionType: [ "string", ... , "string" ],
<optional, values=(smileToActivate) default = all, "" = no actionType>
actionId: [ "string", ... , "string" ],
<optional, default = all, "" = no actionId>
name: [ "string", ... , "string" ],
<optional, default = all, "" = no name>
company: [ "string", ... , "string" ],
<optional, default = all, "" = no company>
moniker: [ "string", ... , "string" ],
<optional, default = all, "" = no moniker>
personId: [ "string", ... , "string" ],
<optional, default = all, "" = no personId>
hasPersonId: <boolean>,
<optional, default = all>
hasName: <boolean>,
<optional, default = all>
hasMoniker: <boolean>,
<optional, default = all>
hasRootEventId: <boolean>,
<optional, default = all>
gender: [ "string", ... , "string" ],
<optional, default = all>
age: [
<optional, default = all>
{
min: <float>,
max: <float>
},
...
],
smile: <boolean>,
<optional, default = all>
avgSentiment: [
<optional, default = all>
{
min: <float>,
max: <float>
},
...
],
liveness: {
<optional, default = all>
min: <float>,
max: <float>
},
livenessConfirmed: <boolean>,
<optional, default = all>
mask: <boolean>,
<optional, default = all>
similarityScore: {
<optional, default = all>
min: <float>,
max: <float>
},
occlusion: {
<optional, default = all>
min: <float>,
max: <float>
},
site: "string",
<optional if specified at the root>
source: "string",
<optional if specified at the root>
idClass: [ "string", ... , "string" ],
<optional, default = all, "" = no idClass>
directGazeDuration: {
<optional, default = all>
min: <long>,
max: <long>
}
objectType: [ "string", ... , "string" ]
<optional, default = all, "" = no objectType>
objectId: [ "string", ... , "string" ],
<optional, default = all, "" = no objectId>
}
triggers : [
{
triggerId : "string",
<optional>
daysOfWeek: ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],
<optional, default = all>
timesOfDay: [
<optional, default = all>
{
start: "11:00", <required>
end: "17:00" <required>
},
...
],
actions: [
<required - can be empty (no actions)>
"string",
...
],
reply: {
<optional, default = no reply>
"replyDelay": long,
<optional, in milliseconds, default = 0>
"message": "string",
<optional, default = no message>
"disposition": double,
<optional, range [-1 .. 1], default = 1>
"tags": [ "tag1", ... "tagN" ]
<optional, default = no tags>
},
conditionalReply: [
<optional, default = no conditional reply>
{
"actionResponse": [ integer, ..., integer ],
<required>
"replyDelay": long,
<optional, in milliseconds, default = 0>
"message": "string",
<optional, default = no message>
"disposition": double,
<optional, range [-1 .. 1], default = 1>
"tags": [ "tag1", ... "tagN" ]
<optional, default = no tags>
}
...
],
},
...
],
excludeDates : [
<optional, default = none>
"7/4",
"12/25",
"4/10/2017",
...
]
}
...
],
noTriggerReply: {
<optional, default = no reply>
"replyDelay": long,
<optional, in milliseconds, default = 0>
"message": "string",
<optional, default = no message>
"disposition": double,
<optional, range [-1 .. 1], default = -1>
"tags": [ "tag1", ... "tagN" ]
<optional, default = no tags>
},
nFactorDef: [
{
"name": string,
<required>
"failOnMismatch": string,
<optional: "delayed"/"immediate"/"none", default = "delayed">
"maxDelay": <milliseconds>,
<optional, default = 60000 (1min)>
"factors": [
"<factor_name>|<factor_value>",
...
],
"actions": [
"<action_command>",
...
]
},
...
],
emailDef: [
{
"label": string,
<required>
"recipients": [ "recipient1", ... "recipientN" ],
<required, escape sequences can be used>
"subject": string,
<required, escape sequences can be used>
"cc": [ "cc1", ... "ccN" ],
<optional, escape sequences can be used>
"bcc": [ "bcc1", ... "bccN" ],
<optional, escape sequences can be used>
"message": string,
<optional, escape sequences can be used>
"attachments": [ "attachment1", ... "attachmentN" ],
<optional, escape sequences can be used
http://, https://, cvos:// url schemes are supported>
},
...
]
smsDef: [
{
"label": string,
<required>
"recipients": [ "recipient1", ... "recipientN" ],
<required, escape sequences can be used, phone numbers using the the E.164 format required>
"maxPrice": string,
<optional>
"message": string,
<optional, escape sequences can be used>
},
...
],
}
For rules.events that allow arrays, the new event must contain all the specified array elements to match. For example, if a config file specified rules.events.personType as follows:
personType: [
"staff",
"admin",
"guest"
],
Then the new event’s personTags array would have to have all 3 specified personTypes for it to match the rule.
personTags: all elements in one of sub-arrays need to exist in event’s personTags array to match the rule.
disposition refers to how the reply should be perceived by the recipient:
When conditional reply is specified, non-conditional reply is used only as catch-all if none of the action response codes match.
When conditional reply is specified, execution of the FIRST action in trigger will occur in blocking manner to enable retrieval of the response code from that FIRST action.
When conditional reply is not specified, execution of all actions will occur in non-blocking manner.
A reply is generated as follows:
URL used to post the reply: <replyServer>/stream/reply.<Base64(event Id)>
#N - name
#F - first name (name prefix up to first white-space)
#U - surname (name postfix: staring after first white-space sequence to the end of name string)
#T - person type
#S - source
#I - site
#D - person id
#R - root person id
#E - person external id
#G - gender
#A - age (###)
#M - sentiment (#.##)
#L - smile (true/false)
#V - event type
#v - event id
#B - tag type
#C - action type
#b - tag id
#c - action id
#k - direction id
#s - event start time (milliseconds since epoch)
#r - event start date/time (local time)
#p - validation phone
#e - validation email
#H - home location
#t - personTags (comma separate list of personTags)
#O - company
#m - moniker
#<d>m - moniker substring (delimited by white-space)
indexed by single decimal digit 0-9 . E.g.: #0m or #3m
#l - similarityScore (#.####)
#a - idClass
#Z - directGazeDuration
#o - objectType
#d - objectId
#u - occlusion (#.##)
#i - liveness (#.##)
#n - livenessConfirmed (true/false)
#z - mask (true/false)
nFactor actions are started via internal @nFactorStart action within standard trigger actions array:
{
triggerId : "string",
...
actions: [
"@nFactorStart <name>",
...
],
reply: {
...
},
conditionalReply: [
...
]
}
At the time of starting, the following occurs:
Response codes for nFactorStart action:
nFactorStart-ed action are resolved via nFactorResolve commands. When all factors needed for the actions are resolved, actions are executed:
{
triggerId : "string",
...
actions: [
"@nFactorResolve <name> <factor_name>|<factor_value>",
...
],
reply: {
...
},
conditionalReply: [
...
]
}
At the time of resolving the following occurs:
Response codes for nFactorResolve action:
@nFactorStartOrResolve combines starting and resolving into one action. Usually used for generating pseudo events from monikers.
{
triggerId : "string",
...
actions: [
"@nFactorStartOrResolve <name> <factor_name>|<factor_value>",
...
],
reply: {
...
},
conditionalReply: [
...
]
}
@personEventFromMoniker action generates a pseudo person event from moniker created by combining all the resolved factor values (separated by space) in order listed in factors array. The generated event is of type person which is populated with meta-data of person with moniker matching the assembled moniker value.
{
nFactorDef : [ {
factors : [
"moniker|**",
"moniker|1**",
"moniker|2**",
"moniker|3**"
],
actions : [
"@personEventFromMoniker"
]
}
]
}
To send emails using actions, you must do the following:
Obtain an SMTP server account that you can use to send emails.
Configure SAFR so that it’s ready to use your SMTP server account to send emails. You can do this from the Status page of the Web Console. On Windows machines, you can also do this via Tools -> Configure Email Server in SAFR Actions.
Configure the emailDef section of the SAFRActions.config, as described below. Note that your emailDef section can define multiple emails, each one being identified by the label
field.
emailDef: [
{
"label": string,
<required>
"recipients": [ "recipient1", ... "recipientN" ],
<required, escape sequences can be used>
"subject": string,
<required, escape sequences can be used>
"cc": [ "cc1", ... "ccN" ],
<optional, escape sequences can be used>
"bcc": [ "bcc1", ... "bccN" ],
<optional, escape sequences can be used>
"message": string,
<optional, escape sequences can be used>
"attachments": [ "attachment1", ... "attachmentN" ],
<optional, escape sequences can be used
http://, https://, cvos:// url schemes are supported>
},
]
In the actions
field of SAFRActions.config, enter a string with the following syntax: “@emailSend <label>”, where <label> = the label of whichever email within your SAFRActions.config that you want to use.
To use Short Message Service (SMS) notifications within actions, you must do the following:
Obtain an AWS account which is configured for your region so it can send SMS messages.
Configure SAFR so that it’s ready to use your AWS account to send SMS notifications. You can do this from the Status page of the Web Console. On Windows machines, you can also do this via Tools -> Configure SMS Sender in SAFR Actions.
Configure the smsDef section of the SAFRActions.config, as described below. Note that your smsDef section can define multiple SMS messages, each one being identified by the label
field.
smsDef: [
{
"label": string,
<required>
"recipients": [ "recipient1", ... "recipientN" ],
<required, escape sequences can be used, phone numbers using the the E.164 format required>
"maxPrice": string,
<optional>
"message": string,
<optional, escape sequences can be used>
},
]
AWS.SNS.SMS.MaxPrice
attribute here for more information about this field.In the actions
field of SAFRActions.config, enter a string with the following syntax: “@smsSend <label>”, where <label> = the label of whichever SNS message within your SAFRActions.config that you want to use.