SMS Server Tools 3
This site is hosted by Kekekasvi.com
 Menu
Basic information:
Additional information:
Support:
Get SMS Server Tools 3:
Additional Options

 Sponsored links

 Search
Custom Search

 Visitor locations
 
 SMS Server Tools 3 Community
Welcome, Guest. Please login or register. Fri Mar 29, 2024 10:14
SMSTools3 Community » Help and support Bottom

[answered] feature "DAILY_REBOOT"

  This topic is locked

Page:  1

Author Post
Member
Registered:
Mar 2010
Location: Ukraine
Operating system name and version: altlinux 2.4
Version of smsd: 3-3.1.7beta3
Smsd installed from: sources
Name and model of a modem / phone: sim300,sim300
Interface: serial,serial


DAILY_REBOOT='On'
DAILY_REBOOT_HOUR='5'

for events
regular_run_cmd
on time get ballance account in 05:00am

bad option
crontab * 5 * * * * service sms restart

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
nm11 wrote
DAILY_REBOOT='On'
DAILY_REBOOT_HOUR='5'

Why do you need that smsd is restarted daily at 05:00? Please explain...

nm11 wrote
for events
regular_run_cmd
on time get ballance account in 05:00am

Sorry, but I did not understand the question / suggestion... :(

nm11 wrote
bad option
crontab * 5 * * * * service sms restart

Why is crontab a bad option?

With regular_run features you can do some actions for example daily at 05:00 (about). But if you want that smsd is restarted, you should use some external process to initiate the restart. With init.d script restarting is safe.

Member
Registered:
Mar 2010
Location: Ukraine
Topic owner
keke wrote
nm11 wrote
DAILY_REBOOT='On'
DAILY_REBOOT_HOUR='5'

Why do you need that smsd is restarted daily at 05:00? Please explain...

I use translate.google. from Russian to communicate with you

I must receive the balance in the morning, gsm gateway is used in voice, if I use it in the mode data during the day, it will not work on voice features.
So I have an event that used to initiate regular_run

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
You have two choices.

1) Use the global setting keep_messages = yes. This setting is for testing purposes and after the first run, including the regular_run, modem process will stop automatically. Mainprocess will stop after all modem processes are stopped.

This kind of a configuration will do the job (as an example):

devices = GSM1, GSM2
keep_messages = yes
logfile = /var/log/smsd.log
loglevel = 7

[GSM1]
device = /dev/ttyS0
regular_run_cmd = AT+CUSD=1,"*100#",0;
regular_run_interval = 300
regular_run_logfile = /var/log/smsd_GSM1.log

[GSM2]
device = /dev/ttyS1
regular_run_cmd = AT+CUSD=1,"*100#",0;
regular_run_interval = 300
regular_run_logfile = /var/log/smsd_GSM2.log

You should use crontab to run "service sms restart", but you do not have to take care about stopping.

Drawback of this solution is that if the SMS's have been received, they will stay in the modems memory and are re-read again every morning. Other actions are needed to remove messages from the device.


2) Use the configuration as shown, but with keep_messages = no setting (or just delete that line). In this case smsd does all the job and continues running. You will need an external script, which is called from crontab. The script could be like the following. Remember to make it executable.

#!/bin/bash

service sms restart
sleep 60
service sms stop

Smsd will be stopped after one minute of running.


In both cases, you will have current information about the balance in the log files. It is also possible to use the same log file for both modems.

You can also use the regular_run_statfile, but it must be unique for each modem. This file will contain the latest information in single line.

Member
Registered:
Mar 2010
Location: Ukraine
Topic owner
keke wrote
devices = GSM1, GSM2

If I use 1 gsm for voice and 1 for sms?

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
nm11 wrote
keke wrote
devices = GSM1, GSM2

If I use 1 gsm for voice and 1 for sms?

You can use two different configuration files:

/etc/smsd.conf.single
- normal configuration for single modem which is running all the time

/etc/smsd.conf.both
- configuration for getting the balance, as shown before

Create a symbolic link:
ln -f -s /etc/smsd.conf.single /etc/smsd.conf

Modify the script which is called from crontab:


#!/bin/bash

ln -f -s /etc/smsd.conf.both /etc/smsd.conf
service sms restart
sleep 60
ln -f -s /etc/smsd.conf.single /etc/smsd.conf
service sms restart

At 05:00 smsd.conf is replaced and smsd runs 1 minute with it. Balance is updated into the log files. Then a normal smsd.conf is restored and smsd will continue running with single modem.

Member
Registered:
Mar 2010
Location: Ukraine
Topic owner
propose an additional option.
option with the flag regular_run.gsm1.flag
When the flag is run regular_run by events rather than on time.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
nm11 wrote
propose an additional option.
option with the flag regular_run.gsm1.flag
When the flag is run regular_run by events rather than on time.

You could use the regular_run_cmdfile option. When this file exists, commands from it are sent to the modem. Use some external process to create this file when necessary.

Member
Registered:
Mar 2010
Location: Ukraine
Topic owner
Quote

Thank you, immediately noticed the powerful functionality of the program, affects not English language

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
As you are still searching for the solution for your setup, can you explain why that "dual configuration" with a "script called from crontab" or "called manually when required" does not apply to you?

  This topic is locked

Page:  1

SMSTools3 Community » Help and support Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.