Running a script when Asterisk reloads/restarts

Status
Not open for further replies.

NellyB

Joined
Apr 28, 2011
Messages
44
Reaction score
0
Hi guys, does anyone know how to run a script when asterisk reloads or restarts?

I've got a process connected to Asterisk on my Elastix system via the AMI. Each time Asterisk is reloaded or restarted the connection to the AMI is lost and the process needs to reconnect.

I've got a small script that will restart my monitoring process that I would like to run after Asterisk has reloaded or restarted but am not sure where to put it.

I could put in in /etc/init.d/asterisk to catch it when asterisk is started but what about amportal restart/reloads via the GUI? Is there one place to put the agent restart script?

Or is there a better way of doing this so the AMI doesn't lose connection?

Any help gratfully received!

Neil
 
Hi.

I think at a stuff.
I don't know if it's the better way, but....

If Fail2ban is able to launching action from a log file, then you could use it to launch your script!

In this case, just playing with these config files:
jail.conf
/filter.d
/action.d

And create your own filter and action file.

Just an idea like that.

Regards
 
i like it - thanks franck!
 
Status
Not open for further replies.

Latest Posts

Members Online Now

Forum statistics

Threads
111,861
Messages
589,439
Members
164,701
Latest member
yarusemiKK