keywords: ip pbx voip gateway gsm gateway

×

Notice

The forum is in read only mode.
× Questions about VS-GW2120/GW1600/GW1202 and WGW1002G GSM Series VoIP Gateway

WGW1002G permanent change of crontab/root (solved)

7 years 11 months ago - 7 years 10 months ago #11054 by max
Hello Support and Userbase,

I just resently bought a WGW1002G (details see below). My requirement is to send sms or make a call from the WGW1002G itself automatically once a month. Therfore I checked how to send sms via the commandline, that was easy, I can send a SMS like this:
asterisk -rx "gsm send sms 1 +44xxxxxxxxx my_sms_text"
. In the next step I tried to send this automatically once a month. Therfore I did a modification to /etc/crontab/root but allways when the power of the device is gone the modification is gone again too.

Could someone please tell me how to permanently make changes in the crontab file /etc/crontab/root or which other tricks there might be to send a sms from the device once a months?

Best Regards,
Max

Details of my WGW1002G:
Model Name: VS-GGU-E2M0400
Modem Description: 850/900/1800/1900MHz@GSM
Software Version: 2.3.0
Hardware Version: Date 2014-04-21 FPGA 11 Hardware 00
7 years 11 months ago #11055 by crystal.han
Hi,
Our gsm gateway is read-only file system,you want to write changes,you can add script in the startup items.
7 years 11 months ago #11056 by crystal.han
Edite file /etc/asterisk/gw/custom.sh to add to what you want.
7 years 11 months ago #11057 by crystal.han
After modify the configuration file,please execute this command:/my_tools/sync2flash .
if not ,after reboot ,the configuration will be lost
7 years 10 months ago - 7 years 10 months ago #11065 by max
Thank you for the advice, I copied the code from the start script for the custom.sh and it works :)
#!/bin/sh

#custom mod - send sms once a month, on the 18. at 20:00.
CRON_PATH="/etc/asterisk/gw/crontabs_root";
if ! grep 'gsm send sms' $CRON_PATH > /dev/null 2>&1 ;then
	echo "0 20 18 * * asterisk -rx \"gsm send sms 1 +43xxxxxxxxx greetings_from_sms_gateway\"" >> $CRON_PATH
fi
Time to create page: 0.050 seconds
Powered by Kunena Forum