XML Protocol Version 1.5.2 en
XML Protocol Version 1.5.2 en
AG/AT/FP/SD/LX/PX/CP
cummunication server
p.blaszczyk@ebs.pl
Communication Server (thereafter: CS) waits in any number of its TCP/IP or UDP ports for
input data fed by AG/AT/FP/SD/LX/PX/CP devices via any number of GSM modems or
SMSC connections. The data are next sent to a virtual external program that analyzes them
(thereafter: AL). Transmissions use one of the three following data exchange protocols:
XML (the format described within this document)
ContactID
SIA
and one of the three following networking protocols:
RS232
TCP/IP
UDP.
The following data are sent either as soon as the connection is established (TCP/IP) or at the
beginning of every message (UDP, RS232):
</xml_cs>
where:
sq sequential number of the packet (for acknowledging purposes)
id communication server ID
count number of messages in the packet before filtering
rep transmission attempt sequential number (repeat)
dt device type ("ag", "at", "fp", "sd", "lx", "px", "cp" or"cs")
sn device serial number
dts device-assigned timestamp (if available)
csts communication server-assigned timestamp (UTC format)
src source of the message as defined by the user (e.g. "TCPn", "UDPn", "SMSn", "SMSCn")
evt event code from an user-defined vocabulary
evtData hex data associated with the event code (e.g. 0x012345678, RFID of the queried point).
3. Description of parameters
3.1 Basic parameters
3.1.1 Sequential packet number (sq)
The first packet sent after the server is started is assigned sequential number equal to 0,
subsequent packets are assigned numbers sequentially incremented. The same sequential
number and value of parameter "rep" greater than 1 means the packet is re-transmitted since
no acknowledgment has been received before the respective time-out. Every packet
(regardless whether sent the first time or re-transmitted) should be acknowledged
(indispensable in case the acknowledgment is lost).
Event names (evt) and event data (evtData) for FPX, SDX, Active Guard and Active
Track(Active Guard, Active Guard II, Active Track) devices. If there is no clear indication of
corresponding device, events are considered to be defined for all four types mentioned above.
Table 1. Set of the possible events and data for AG, AT, FP, SD devices.
textMessageRecei
ved
Response message received from device. TXT_MSG_RECEIVED
veryLowBatteryBe
gin
Very low battery voltage (device goes into sleep mode). VERY_LOW_BATT
veryLowBatteryEn
d
End of very low battery voltage. VERY_LOW_BATT_END
Character string comprising state description valid at the time of event creation:
• advOpt – So called 'advanced optimization' it turned on. Algorithm has decided to send information
about location change.
• timeout – Configured time since last LOCATION_UPDATE event has elapsed.
• fix – So called GPS FIX has returned (sent only by some kind of devices like ATDoor or TPT).
• heading – Course changed by configured angle compared to last LOCATION_UPDATE event.
• position - Position changed by configured length compared to last LOCATION_UPDATE event.
3.2.2 PX events.
Table 2. Event names (evt) and event data (evtData) for PX (PX, EX) devices.
connect The method the device connected (src parameter may be CONNECT
used to find out the method).
timeout Specified time from the most recent transmission has TIMEOUT
expired.
disconnect The method the device disconnected (src parameter may DISC
be used to find out the method).
3.2.3 LX events
Table 3. Event names (evt) and event data (evtData) for LX (LX10, LX20, LX20G,
LX20GL, PX100N, PX200N, PX100D, EX10, EX20) devices.
connecting The method the device connected (src parameter may be CONNECTING
used to find out the method).
connect Specified time from the most recent transmission has CONN
expired.
timeout The method the device disconnected (src parameter may TIMEOUT
be used to find out the method).
modeChange The method the device connected (src parameter may be MODE
used to find out the method).
clockAdjust Specified time from the most recent transmission has CLOCK_ADJUST
expired.
tooManyDataServe DATA_LIMIT_EXCEEDED
rAlert Amount of data sent by the device exceeded defined
threshold within certain period of time.
sabSwitchLock Temporal lock of sabotage input turned on/off . SAB SWITCH LOCK/ SAB
sabSwitchUnlock SWITCH UNLOCK
veryLowBatteryBegin Very low battery voltage (device goes into sleep mode). VERY LOW BATT
veryLowBatteryEnd End of very low battery voltage. VERY LOW BATT END
3.2.4 CP events
Table 4. Event names (evt) and event data (evtData) for CP (GD30.2/CPX200N) devices.
status Status message has been received after "get status" STATUS
command was issued.
connecting The method the device connected (src parameter may be CONNECTING
used to find out the method).
connect Specified time from the most recent transmission has CONN
expired.
timeout The method the device disconnected (src parameter may TIMEOUT
be used to find out the method).
modeChange The method the device connected (src parameter may be MODE
used to find out the method).
clockAdjust Server sent set time event to device (automatic time CLOCK_ADJUST
synchronization).
inVoiceCallBegin Begin of incoming voice call (the number was on DIAL IN_VOICE_CALL
list).
input24hPanicArm 24h burglary line turned on / off. Event exclusive for CID-
input24hPanicDisarm SIA analyzers.
inputIntDelayArm Conditional delayed line turned on / off. Event exclusive for CID-
inputIntDelayDisarm SIA analyzers.
input24hPanicSil 24h burglary silent turned on / off. Event exclusive for CID-
entArm SIA analyzers.
input24hPanicSil
entArm
3.2.5 CS events
Table 5. Event names (evt) and event data (parameters) for Communication Server.
Parameters
count="number_of_lost_events"
Example
GSM|GPRS|NOSRV|NOSMS|NOCSD|NOVOICE
4000mV
BATT_VOL_OK|NO_VERY_LOW_BATT|CHARGER_CONN|NO_CHARGING
100
gps Last gps location. First word in attribute is gps location mode:
2D
3D
DGPS
Format for 2D
2D yyyymmdd hh:mi.ss lat,long horizontalAcc null velocity heading
where:
• yyyy – year, mm – month, dd – day
• hh – hours, mi – minutes, ss – seconds
Format for 3D
3D yyyymmdd hh:mi.ss lat,long horizontalAcc,verticalAcc altitude velocity heading
where:
• yyyy – year, mm – month, dd – day
• hh – hours, mi – minutes, ss – seconds
• lat – Latitude in degrees (positive values N, negative values S)
• long – Longitude in degrees (positive values E, negative values W)
• horizontalAcc – horizontal accuracy in meters. Equals 0 if unknown.
• verticalAcc – vertical accuracy in meters. Equals 0 if unknown
• altitude – (in m)
• velocity – velocity [m/s]
• heading – (in degrees)
Example message:
Example
GSM|GPRS|NOSRV|NOSMS|NOCSD|NOVOICE
BATT_VOL_OK|NO_VERY_LOW_BATT|CHARGER_CONN|NO_CHARGING
INSTANT
1
2
1,2
CONNECTING
Generated only when a known device tries to connect (only AG, AT, FP, SD or LX in
encrypted transmission mode).
CONNECT
Generated only when a known device connects, provided that the device was in the
DISCONNECT state.
TIMEOUT
Generated once after specified time from the most recent transmission expired.
DISCONNECT
Generated after specified time expired or in result of a deliberate disconnect command,
provided that the device was in the CONNECT mode.
MODE_CHANGE
Generated at the moment the device-server communication mode is changed, provided that
the device was in the CONNECT mode (combination of three or two events: DICONNECT-
CONNECTING-CONNECT or DISCONNECT-CONNECT).
NEWADDRESS
Generated before the relevant event CONNECT or MODE occurs, contains data on the device
network address (IP:port) or phone number
connecting
evt=CONNECTING
connection
evt=NEW_ADDR
evt=CONN
event
evt=event
timeout1
evt=TIMEOU
event T
evt=event
unexpected
disconnection
timeout2 evt=DISCONNECT
Acknowledgment time-out is fully configurable. In the case of the TCP/IP analyzer does not
send proper acknowledgements for a period longer than 2 minutes OSM will close and try to
reestablish TCP/IP connection.
CS </xml_cs>
AL </xml_al>
The last pair of messages is sent only when one of the parties wants to close connection
gently.
</packet>
Where:
sq sequential number of the packet (only for detection of repeats). Sequential number of
each packet should be incremented by some value (repeats are discarded)
id analyzer program ID (from config.xml file, default is "primary")
count number of messages in the packet
rep transmission attempt sequential number (repeat)
ALNetworkAddress optional network address of the analyzer in the form IP:port used for the purpose of
the audit (note: the parameter is used only when the OSM is not able to determine the
real address for example, when using SSH tunneling; it is sufficient to specify this
parameter once)
</xml_al>
Message format:
sq sequential number of the message (for acknowledging within the response). The range
of this parameter is 0-232 (messages with the same sq number are not discarded)
command command name
type (option) device type ("ag", "at", "fp", "sd", "cp", "lx" or "px")
sn (option) device serial number
Any given AL program instance may configure parameters of only those devices,
which are assigned to it (that send their data to it). Each device is identified by its type and its
serial number. Some device parameters (phone numbers, encryption keys) are assigned
directly to individual devices, while other (timeout value) – to templates. Each template is
identified by an unique name. Each template may support devices of only a single type and is
assigned to a single AL instance (in other words no other AL instance may modify it).
devices.xml
Template A Template B Template C
Group I Group II
config.xml
Example:
Response:
4.2.2 Authentication
Every authentication attempt should follow initialization phase (section. 4.2.1).
ChallengeResponse value is
generated by the following formula:MD5("AL_NAME:PASS:SEED") where:
For example:
Then: challengeResponse=MD5([0x70 0x72 0x69 0x6D 0x61 0x72 0x79 0x3A 0x61 0x62
0x63 0x64 0x3A 0x18 0xE6 0x5B 0x1C 0xEB 0x47 0x20 0x7F 0x22 0xE2 0xDD 0x86 0xA1
0xE4 0xD9 0x2D 0x76 0x2B 0xBB 0xAC 0x0D 0xA8 0x89 0xA0 0x5F 0xD0 0xF5 0xCB
0x5D 0xDB 0x80 0x41])
Example:
Response:
Example:
type type of devices covered by the queried templates (ag, at, fp, sd, lx, cp or px)
name unique template name
netTimeout1 if this timeout expires, the TIMEOUT event is generated
netTimeout2 if this timeout expires, the DISCONNECT event is generated (network mode)
smsTimeout if this timeout expires, the DISCONNECT event is generated (SMS mode)
all timeouts in seconds
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Response:
Example:
Example:
1. CS listens
3. CS responds:
The commands mean: (i) add or modify parameters of Active Guard device with serial
number 2000; (ii) add or modify parameters of PX device with serial number 8899; and (iii)
add an existing device.
5. CS responds:
6. To disconnect, AL sends:
</xml_al>
</xml_cs>
Commands are transmitted via the same communication channels that is used to
configure devices. Only devices associated with the given AL program instance may be
controlled. Number of commands that may be sent to a device is limited (by default up to 10).
Queue of commands to-be-sent to a PX/EX device may contain only a single command of
each type. General command format:
Response format:
status "SEND / NOT SEND / SEND NO ACK / QUEUE FULL / NOT SEND MSG TOO LONG"
meaning respectively:
command sent and acknowledged /
command could not be sent before expiration of its validity period /
Commands send to Active Guard devices as SMS messages could not end with "SEND"status
(no immediate response). Status of a command sent to Active Guard device as SMS message
will be always "SEND NO ACK". Eventually SMS response from device will be received and
send to analyzer as a "TextMessageReceived"event.
Example:
Response:
Example:
Response:
Example:
Response:
Example:
Response:
Example:
Response:
Example:
Response:
Example:
Rsponse:
Example:
Response:
Response:
Example:
Response:
Example:
Response:
Example:
Response:
Parameters interpretation:
input
• num input number (currently 1…8)
• state ON (activated) / OFF (not activated)
• blk ON (locked) / OFF (unlocked)
output
• num output ID (currently "aux"and "sab")
• state ON (turned on) / OFF (turned off)
zone
• num zone number (currently 1 or 2)
• state ON (turned on) / OFF (turned off)
accu
• state LOW (low battery) / OK (battery OK)
power
• state LOW (no power supply) / OK (power supply OK)
sabSwitch
• state ON (relay activated) / OFF (relay not activated)
• blk ON (locked) / OFF (unlocked)
phoneLine
• state ON (phone line connected) / OFF (phone line not connected)
Response:
Example:
Response:
Example:
Response:
Example:
Response:
Example:
Response:
Example:
Response:
Example:
Response:
After sending this command OSM will try to generate link state signal (still connected or still
disconnected) for every device. In this way any external application may synchronize devices
link state after connection to OSM was lost1.
Attention: frequent invoking of this command is not recommended as it may cause stalls in
communication channel and it could shorten the lifetime of flash memory (if applicable)! You
should wait at least 90 seconds since last generateStateSignal command call (the OSM will
refuse to do it with higher rate).
Example:
Response:
1
You should take into account that after loosing and restoring connection to OSM devices may change their link
state to the opposite condition.
Example:
Response:
Example:
Response:
You may use this command many times, previous settings are overridden by the new ones.
Example:
Response:
Example:
Response:
Example:
Response:
Przykład:
Response:
Example:
Response:
Example:
Response:
Example:
Response:
time OSM’s current date and time in "yyyy-mm-dd hh:mm:ss"format, GMT0 zone
Example:
Response:
or
Example:
Response:
OSM configuration is divided into two types: "running"and "configured". Both types
of configurations are equal to each other right after start of OSM. The differences appear after
changing OSM settings. It is recommended that application which shows and modifies OSM
settings should be able to display both types of configuration. For every command of this type
as a result we get "result"XML attribute with following values:
CONFIGURED – values has been saved and will be used after OSM restart
CONFIGURED_AND_RUNNING – values has been saved and made current
CONFIGURED_PARTIALLY_RUN – all values has been saved and some of them
made current
ERROR – an error occurred during configuration phase (e.g. wrong module name
was used)
Only some of parameters are validated by OSM during configuration phase. These are: name
of changed object ("name") and type of configuration ("type"). If these parameters are invalid
or analyzer is not authorized for changing OSM settings then error code (errorCode) and
error description (errorDesc) are returned as a result. Application which modifies OSM
settings is responsible for settings valid values for all parameters (see OSM manual).
Example:
Response:
Response:
Example:
Response:
Example:
Response:
Example:
Response:
Example:
Example:
Response:
Example:
Response:
Example:
Response:
Example:
Response:
Example:
Example:
Response:
Example:
Response:
Example:
Example:
Response:
Example:
Response:
Example:
Response:
encryptSharePassWithRSAKey
2048-bit asymmetric RSA key generated by OSM for network share passwords
encryption passed in ASN.1 syntax as a modulus and exponent, hexadecimal
notation with "0x"prefix
Example:
Response:
3. CS responds:
6. CS responds::
7. To disconnect, AL sends::
</xml_al>
</xml_cs>
AG type AG type
Parameter PX/EX LX/PXN/PXD CP
(≤65535) (>65535)
Access code (ac) ● ● ●
● ○ (0-7 ASCII (0-7 ASCII (0-7 ASCII
(4 digits)
characters) characters) characters)
Separate SMS
cipher key ○ ○ ● ● ●
(252 bits) (252 bits) (252 bits)
(SMSkey)
Cipher algorithm ● ● ● ●
(cipher) ○ (DES) (AES256) (AES256) (AES256)
DTMF decoding
(DataDecode) ● ○ ○ ● ○
DTMF object
number ● ○ ○ ● ○
(DataObjNum)
AG type – AG/AT/FP/SD
7. Document history
7.1 Changes and corrections
7.1.1 Changes for version 1.1.0
• Section 4.2.3 ac parameter added.
• Section 4.2.3 example response corrected.
• Section 4.2.4 example response corrected.
• Tamper switch added as another input.
• Example request corrected, num parameter added.
• Section 4.2.6 example request corrected, num parameter added.