Gammu documentation related to gammu-smsdrc
config says
RunOnFailure New in version 1.28.93.
Executes a program on failure.
This can be used to proactively react on some failures or to interactively detect failure of sending message.
The program will receive optional parameter, which can currently be either INIT (meaning failure during phone initialization)
I have added the following to my /etc/gammu-smsdrc
config file:
RunOnFailure = /home/pi/fail.sh
How do I access and use the parameter INIT
? I want to setup SMS notificaion on failure of phone initialization.
I figured it out. There are two scenarios of failure.
Problem with sending a message. In which case $1
(bash) will be an integer which is the row id of message in MySql database. I am not sure what its going to be if you have configured Gammu in file backend mode.
Gammu cant access or connect to the phone or GSM modem. In this case $1 = INIT
.
I am using a PHP script to RunOnFailure
so it is going to be $argv[1]
for me.