Receive SMS – Execute scripts on received SMS
To have a incoming SMS on your server execute a list of programs or commands, you must create a Windows script file (.BAT) The name of this file (for example DOIT) will be the key to start the script from a mobile. The additional text will be available for the programs in your script as one of the parameters. Consult the SysManSMS User and Developers Guide for details on each program or server command you like to be executed.
Let’s create a script in the servers Programs folder called DOIT.bat
In our example, server’s number is 12345678, and the mobile’s is 87654321
REM Save DOIT.BAT in your servers Programs folder REM REM Sending the SMS "DOIT NUMLIST1" will execute the following commands: REM REM parameter %1 will contain mobile number that started this procedure REM parameter %2 will contain the text sent from the mobile REM parameter %3 will contain the time the message was sent from mobile REM Make sure your BAT process has correct folder for the program to execute C: cd \Program Files\SysManSMS\CMDclient REM Use the CMDclient to send a command to a mobile or the server itself SysManSMS_CMD.exe "12345678" ":VCFWD %1" REM Make sure your BAT process has correct folder for the next program cd \Program Files\SysManSMS\GSMserver\Programs REM Execute a program from servers Programs folder seti.exe %1 %2 %3
This is how your server log will look like after script execution:
06-Jul-2012 10:30:06 Message received from +4787654321 (S:12/07/06 10:29:16) 06-Jul-2012 10:30:06 Mobile user [+4787654321] started process [DOIT] successfully 06-Jul-2012 10:30:07 * New SMS network request detected, now processing client [CMDclient.FT92] 06-Jul-2012 10:30:10 Message 150 to 87654321 sent OK (TXT), delivery status not requested 06-Jul-2012 10:30:10 * New SMS network request detected, now processing client [SDK.seti] 06-Jul-2012 10:30:13 Message 151 to +4787654321 sent OK (TXT), delivery status not requested 06-Jul-2012 10:30:13 Message received from +4712345678 (S:12/07/06 10:29:24) 06-Jul-2012 10:30:23 Message 152 to +4712345678 sent OK (TXT), delivery status not requested 06-Jul-2012 10:30:23 Mobile user [+4712345678] changed Voice Call Forwarding to [+4790030920] 06-Jul-2012 10:30:23 Mobile user [+4712345678] executed command [VCSET] successfully 06-Jul-2012 10:30:25 Message received from +4712345678 (S:12/07/06 10:29:37) 06-Jul-2012 10:30:25 WARNING - Mobile user [+4712345678] failed to start default process [default.exe] 06-Jul-2012 10:30:25 Message exported to text file c:\SysManSMS\OUTPUT\FT92_InfoPage.txt