SecBox dual sided NEW!
Dual sided is used when two devices control the same door, one on each side, through the default SecBox (door 1). When the door is opened without a command from this device, it queries the peer device to find out whether the opening was commanded from the other side, before deciding on a forced-door alarm.
Communication between the peers is authenticated with HMAC-SHA256, using a 32-byte shared secret stored on both devices.
Available only on iDAccess line devices.
Configuration
Dual sided is configured through the dual_sided module, using Modify Configurations:
| Parameter | Type | Description |
|---|---|---|
| enabled | string | "1" enables dual sided; any other value keeps it disabled. Default: "0". |
| confirmation_timeout | string | Time, in milliseconds, for the peer to answer the query. Values from 500 to 5000. Default: "2000". |
| response_grace | string | Tolerance, in milliseconds, added to the end of an opening commanded by this device when it answers the peer's query. Values from 0 to 5000. Default: "2000". |
| door1_peer_address | string | Address of the peer device, in the http://<IPv4>[:port] or https://<IPv4>[:port] format. Default: empty. |
The shared secret is not part of the configuration: it is stored with the set_dual_sided_secret command.
Store the shared secret
POST /set_dual_sided_secret.fcgi
Stores the shared secret used to authenticate the communication with the peer. The same secret must be stored on both devices.
Requires an administrator session. With any other access level, the call returns HTTP status 401 and the error "Invalid access level for command set_dual_sided_secret".
The secret is never returned by the API and is not written to the audit log.
Parameters
- secret (string): Required. Shared secret, with exactly 64 hexadecimal characters (32 bytes). Upper and lower case are accepted. Otherwise, the call returns the error "Invalid secret".
Response
- This call has no return.
If the secret cannot be stored, the call returns the error "Unable to store secret".
Request example
$.ajax({
url: "/set_dual_sided_secret.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({
secret: "3f1c9a7be2d04856a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718"
})
});
Get the dual sided status
POST /get_dual_sided_status.fcgi
Reports whether the shared secret is stored and whether the peer address is valid. The secret is never returned.
Parameters
- This call has no parameters.
Response
- secret_configured (bool): Whether a shared secret is stored on the device.
- door1_peer_address_valid (bool): Whether the door1_peer_address parameter contains a valid address.
Request example
$.ajax({
url: "/get_dual_sided_status.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json'
});
Response example
{
"secret_configured": true,
"door1_peer_address_valid": true
}
Query between peers
POST /dual_sided_query.fcgi
Route used by a device to query its peer. It is not meant for integrations: the request must be signed with the shared secret, and the device itself builds and sends it. It is described here only so that the route can be recognized, for example in firewall rules.
This route does not require a session. The rate is limited to 20 requests per second and the body to 1024 bytes. Any failure (dual sided disabled, secret not stored, invalid request or wrong signature) returns HTTP status 400 with the body {"error":"Invalid request","code":1}, without stating the reason. Queries are not written to the audit log.
Parameters
- version (int): Protocol version. Currently
1. - device_id (string): Identifier of the querying device, in decimal.
- door (int): Logical door queried on the peer. Currently only
1. - age_ms (int): Time, in milliseconds, from the door opening to the moment the query is sent. Values from
0to60000. - nonce (string): Random value of 32 lowercase hexadecimal characters.
- mac (string): HMAC-SHA256 signature of the request, in 64 lowercase hexadecimal characters.
Response
- version (int): Protocol version.
- nonce (string): The same nonce as the request.
- door (int): The same door as the request.
- commanded (bool): Whether the peer confirms it commanded the door opening at that moment. With emergency mode active, the peer always answers
true. - cause (int): Reason for the commanded opening;
0when commanded isfalse. - window_id (int): Identifier of the commanded opening;
0when commanded isfalse. - boot_id (string): Random identifier of the peer's current access software run, in 16 hexadecimal characters.
- device_id (string): Identifier of the answering device, in decimal.
- mac (string): HMAC-SHA256 signature of the response.
Response example
{
"version": 1,
"nonce": "9f2c4e1a7b3d5f6081a2b3c4d5e6f708",
"door": 1,
"commanded": true,
"cause": 1,
"window_id": 12,
"boot_id": "5a1f3c9e7b2d4086",
"device_id": "478435",
"mac": "c0ffee00112233445566778899aabbccddeeff00112233445566778899aabbcc"
}