Ergent Help Please Cronjob howto?!!

Status
Not open for further replies.

ahmed_gaffar

Joined
Jan 10, 2011
Messages
44
Reaction score
0
Hello all,
I have a Gateway connected to the internet with "dynamic hostname" and i connected this Gateway to my Elastix- A2Billing server and every thing going ok ... the problem is the internet provider where the Gateway connected changing his pool every 15 Hours and Asterisk lost the connection to the Gateway till i reload the Asterisk. then the Gateway is again connecting to Asterisk and i can terminate calls. Q is can i do this with cronjob and how? any advice will be great.
 
Hi.

What's the status of this trunk when it not work?

Maybe using this trunk option: Monitor Trunk Failures
If checked, supply the name of a custom AGI Script that will be called to report, log, email or otherwise take some action on trunk failures that are not caused by either NOANSWER or CANCEL.
 
Hello danardf and alot of thankx for your fast replay, i dont know what is the status of the trunk but no call will go through untill i make reload for Asterisk, and in the Flash Operater Panel i can see that this trunk not connected is.
 
In this case, try to use this option.
Go to extensions_custom.conf.
Make a function like this:
Code:
[reload_ast]
exten => s,1,NoOP("Reload will started")
exten => s,n,System(asterisk -rx 'reload')
exten => s,n,Hangup()

Reload manually asterisk.

Next, enable Monitor Trunk Failures and put this in the field : reload_ast,1,n.

When the trunk conditions will be there, then reload_ast will launched.

In any case, it's the way that i'd try.
I hope that this code will work. ;)
 
my dear Frank,

you made my day -:) thanks for your answer :side: i will try it and will tell you as soon as my provider change his connection pool to see how it will work. alot of greetings ...
 
Ok, let me know. ;)

However, you could make some test making a custom destination.
Enter reload_ast,s,1
Next, assign a number to this function
*151 for example.

Dial *151 from an extension and check if Asterisk reloading.

regards
 
my dear danardf,

Is there is any way how can i control this code with time? i mean, if i wish to make the check after 10min if the first time of reload is not connected to the trunk, and again after 10min if the second time of reload didn't connect the trunk, because some times the trunk is faild because of energy provide or something. So i thougt i can repate the proccess in time of 10min ... and so!

exten => s,1,NoOP("Reload will started")
exten => s,n,System(asterisk -rx 'reload')
exten => s,n,Hangup()


is reloading the machine continously which make the machine to crash!! or what do you think? for any advice i'll be happy.
 
Look at this post using fail2ban (In French, but with google translator ;) )

http://www.elastix.org/index.php/en/com ... 0&start=30

Just modify actionban = /folder/else/your_script

When a trunk error appear, then the script will launched.

Regards

I was made a mistake about
Next, enable Monitor Trunk Failures and put this in the field : reload_ast,1,n.
, sorry.
Just put your script here /var/lib/asterisk/agi-bin/
chmod 755
and into Monitor Trunk Failures ,put this in the field : your_scipt_name

Else to make what you do, you must make some shell script running by the crontab.

Regards
 
Status
Not open for further replies.

Forum statistics

Threads
111,859
Messages
589,434
Members
164,699
Latest member
CLTedu