Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

Event

Description

Comment

RECEIVE

Message is received

Use the ProcessFromSim registry key if event is not received while message receiving (see Registry keys reference guide).

Text of sent message is in the message <> parameter.

The telephone number in the +7XXXXXXXXXX  format from which message was sent is in the phone<> parameter.

...

Code Block
DoReact("SMS","_id_","_command_" [,"_parameters_"]);

List of commands and parameters for the the SMS object is presented in the following table:

Commandcommand description

Parameters

Description of parameters

"SETUP" – settings of short message service

device<>

SMS device

flags<>

Flags

message<>

Message text

name<>

Object name

phone<>

Telephone number

...

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.

...