User guide

eWON 500-2001-4001-4002 User Guide - Programming the eWON
eWON 500®2001®4001®4002® Version 4_3_0 - User Guide - 10/5/05 - ©ACT'L sa - Page 153
9.2.54 ONSMS
Syntax [command]
ONSMS S1
• S1 is the command line to execute when eWON receives a SMS.
Purpose:
A typical use of the ONSMS syntax is allowing eWON to send a read SMS receipt to the SMS sender.
You can read the received SMS with GETSYS PRG function with:
• smsRead:
hold 1 if there is a new SMS (reading smsRead load the other parameters)
hold 0 if the SMS queue is empty
• smsFrom:
String holding the phone number of the sender
• smsDate:
String holding the Date of SMS reception
• smsMsg:
String holding the SMS message
Example:
9.2.55 ONSTATUS
Syntax [command]
ONSTATUS S1
• S1 is the command line to execute when a scheduled action is finished.
Purpose:
The EVTINFO parameter (see GETSYS page 141) is set to the ACTIONID of the finished action when command is called.
This function can be used to track success or failure of scheduled actions.
Example:
See also:
“GETSYS, SETSYS” on page 141, “ONxxxxxx” on page 151, “PUTFTP” on page 161, “SENDMAIL” on page 162, “SENDSMS” on
page 163, “SENDTRAP” on page 164
InitSection:
ONSMS "Goto HSms"
HSms:
a% = getsys prg,"SmsRead"
if (a%<>0) then
s% = s%+1
print "SMS Nr: ";s%
f$ = getsys prg,"smsfrom"
print "From: ";f$
print getsys prg,"smsdate"
a$ = getsys prg,"smsmsg"
print "Message: ";a$
b$ = f$+",gsm,0"
c$ = "Received message: "+a$
sendsms b$,c$
goto HSms
endif
end
ONSTATUS "goto Status"