Run script on reload

Status
Not open for further replies.

NellyB

Joined
Apr 28, 2011
Messages
44
Reaction score
0
hi guys, i have a program (AsterClick) connected to an Elastix system, it is used to monitor and control calls via the AMI.

It works great but every time we update the system we lose connection via the AMI. To remedy this, we just stop and restart the asterclick daemon using a script.

Is there a way to avoid losing the connection? Or is there a place I can run the script after clicking the pink bar to restart asterclick automatically?

Many thanks,

Neil

Elastix version is 1.4.
 
Can I get access to the 'reload' code that is run when I update elastix?
 
Hi.

If F2B is able to launch a script following an event, then maybe you could use it to reload Asterix too.
Check if you have some interesting events log about AMI.
Create your specific filter, and a specific action which reload Asterisk.

Just an idea like that. ;)

Regards
 
Franck, what do you think of this?

Look on the sourceforge freepbx page here:
http://sourceforge.net/project/shownote ... _id=402424

The changes for 1.10.010 specify "Ability to execute a script after applying changes in the AMP interface"

Reading up on amportal.conf here:

http://www.cadvision.com/blanchas/Aster ... .conf.html

I see this, which is just what I need:

# POST_RELOAD: automatically execute a script after applying changes in the AMP admin
# Set POST_RELOAD to the script you wish to execute after applying changes
# If POST_RELOAD_DEBUG=true, you will see the output of the script in the web page
# POST_RELOAD=
# POST_RELOAD_DEBUG=false


Do you think it was ever included in the mainstream?

Neil
 
Hi Neil.

I'm happy to know this way. I didn't know this.
However, you could still try it.

Regards
 
I'm cranking up a dev box to try it as we speak - I'll let you know how I get on.

Neil
 
I think that, if you want to launch a script or other, you must put the absolute file, like that.

POST_RELOAD=/usr/bin/your_script and not like this POST_RELOAD=your_script
Else, for example:
POST_RELOAD=/sbin/service asterclickd restart

(I don't know if it's the good syntax)

Next, launching : # amportal restart

However, be careful about the file permission. Maybe to launch service, it must be launched on root and not asterisk!!
 
By god it works!!!

I added this to amportal.conf:

# POST_RELOAD: automatically execute a script after applying changes in the AMP admin
# Set POST_RELOAD to the script you wish to execute after applying changes
# If POST_RELOAD_DEBUG=true, you will see the output of the script in the web page
POST_RELOAD=/etc/asterisk/stats
POST_RELOAD_DEBUG=true


The script /etc/asterisk/stats just touches /etc/asterisk/itworks

Once I reloaded via the pink bar, /etc/asterisk/itworks appeared

Neil
 
great. :)
 
Status
Not open for further replies.

Forum statistics

Threads
111,860
Messages
589,437
Members
164,700
Latest member
Apollo Cloud