almaruf wrote
> I am trying to send sms to many recipients using one file. ( I have seen the post here that contains the script but I rally dont know how to run and enable the script in my Windows Xp environment using Cygwin)
First, most of sample scripts use
formail command and you need to install it. Formail is included in the
procmail package. Run the Cygwin setup and search and install the package named procmail.
You need to create a checkhandler. In the global part of smsd.conf, define:
checkhandler = /usr/local/bin/smsd_checkhandler.shCreate this file with a content from this post:
Multiple recipients in single SMS file. Make the script executable:
chmod 755 /usr/local/bin/smsd_checkhandler.sh.
You can create a message file with multiple recipients, and checkhandler will put recipients to separate files. From smsd's point of view, one message can contain one recipient, because messages are sent one at a time.
almaruf wrote
> Secondly, I am looking for a reporting technique that will enable me to identify which SMS was sent and which was not sent at a one go if I have used many recipients.
In the smsd.conf, define:
sent = /var/spool/sms/sent
failed = /var/spool/sms/failedAs you now have a different file for each recipient, you can monitor
sent directory. If some message fails, you can find it from
failed directory.
If you include an additional header, like
Sending_group: 12345, in your original file, with this header you can check what has been the "sending group". I do not know if that is important to you, but anyway, all headers expect To: headers are copied to each file.
almaruf wrote
> I wanted to read and save the incoming SMS to Mysql database.
Check this post:
Sample eventhandler to store messages into SQL database. It's a sample script which could be defined as an eventhandler. In the smsd.conf:
eventhandler = /usr/local/bin/smsd_eventhandler.shCreate the script and make it executable.
From the same post you can see what kind is a structure of database.
While you are now starting to use scripts, and surely you want to make some changes to them, sooner or later
, please notice: When current version of smsd is running the script, possible errors are now shown and may cause lot of troubles. Because of this, always test your script manually after any changes are done. For example you can run:
/usr/local/bin/smsd_eventhandler.sh RECEIVED /var/spool/sms/incoming/GSM1.aabbcc to see if a message is handled correctly and without error messages.