Go to documentation repository
...
The SMS object sends events presented in the table. Procedure is started when the corresponding event appears.
Format of events procedure for the Short Message Service object:
| Code Block |
|---|
OnEvent("SMS","_id_","_event_") |
Description of events of the SMS object.
occurs.
Event
Description
Event | Event description |
Comment | |
RECEIVE | Message is received |
If the event doesn't occur when a message is received on the modem, you must use the ProcessFromSim registry key |
The message<> message parameter contains the text of the sent message. The |
parameter phone<> contains the phone number from which the message was sent |
, in the |
Operator format to describe actions with the short message service is:
| Code Block |
|---|
DoReact("SMS","_id_","_command_" [,"_parameters_"]); |
+7XXXXXXXXXX format |
List of commands and parameters for the the SMS object is presented in the following table:
Command |
—command description | Parameters | Description of parameters |
"SETUP" |
—settings of short message service |
device<> | SMS device |
flags<> | Flags |
message<> | Message text |
name<> | Object name |
phone<> |
Phone number |
Properties of the SMS object are shown in the table.
Properties of the SMS object | Description of properties |
ID<> | Object ID |
PARENT_ID<> | Parent object ID |
Examples of using events and reactions of the Short Message service object:
...
It is required to send short message to the “89179190909” number while alarm on the first video camera.
| Code Block |
|---|
OnEvent("CAM","1","MD_START")
{
DoReact("SMS","1","SETUP","phone<+79179190909>,message<camera 1, alarm>");
} |
...
Set device for message delivery and send message to the “89179190909” number while alarm on the first sensor.
| Code Block |
|---|
OnEvent("GRAY","1","CONFIRM") //confirm alarm from sensor 1
{
DoReact("SMS","1","SETUP","device<>",); //set device for message delivery
DoReact("SMS","1","SETUP","phone<+79179190909>,message<sensor 1, alarm>"); //send message about alarm on the sensor 1 to telephone number
} |
Play the c:\Windows\Media\Tada.wav audio file while receiving sms using the Mail Message Service 2.
...