Not being a programmer, modified the script from Base122 to check the inbox fo a sms with a recharge voucher every 30 minutes. This would then forward the voucher to my cell provider in Namibia, recgharge my credit, delete the sms and forward me the recgarge sms received after the recharge cycle, and delete this one as well. If there were no sms's in the inbox it simply would not send a recharge sms as the message was emty.
Once again my thanks to Base122 for assisting. (Remember to change your email account as well as your email server settings and the "132" number. )
Set Receive Enabled, in case it was cleared by a router reboot
/tool sms set receive-enabled=yes;
delay 2;
:local smsMessage;
:local smsContent;
:log info "SMS to ReCharge script started";
delay 2;
loop through all the messages in the inbox
:foreach i in=[/tool sms inbox find] do={
:set smsMessage [/tool sms inbox get $i message];
:set smsContent "\nMessage: $smsMessage";
:log info $smsContent;
/tool sms send usb4 "132" message="$smsContent";
Now remove the SMS from the inbox
/tool sms inbox remove $i;
delay 10;
}
:local EmailAddress "jj@jj.com";
:local smsPhone;
:local smsTimeStamp;
:local smsMessage;
:local smsContent;
Get System Identity
:local SystemID [/system identity get name];
:log info "SMS to Email script started";
delay 10;
loop through all the messages in the inbox
:foreach i in=[/tool sms inbox find] do={
:set smsPhone [/tool sms inbox get $i phone];
:set smsTimeStamp [/tool sms inbox get $i timestamp];
:set smsMessage [/tool sms inbox get $i message];
:set smsContent "Router ID: $SystemID\nSMS Received from: $smsPhone\nDate&Time: $smsTimeStamp\nMessage: $smsMessage";
:log info $smsContent;
/tool e-mail send tls=yes subject="$SystemID GSM Modem SMS Received" to=$EmailAddress body="$smsContent";
Now remove the SMS from the inbox
/tool sms inbox remove $i;
delay 10;
}
:log info "SMS to ReCharge script complete";