[Asterisk-Users] Not answering/script.

Adam Goryachev mailinglists at websitemanagers.com.au
Sun May 22 20:28:20 MST 2005


On Sun, 2005-05-22 at 23:01 -0400, Ken D'Ambrosio wrote:
> I've got an Asterisk box at a client; last week, it just stopped answering
> the phone.  Outbound calls still went, but inbound -- no dice.  Asterisk
> didn't even acknowledge that the line was ringing.  A reboot fixed it --
> though, clearly, I can't have them rebooting all the time.

> - Until I resolve the issue, how would I go about writing a script to call
>   the customer from my own Asterisk box, and, if the call doesn't get
>   answered after (say) 30 seconds, send me an e-mail saying that
>   something's wrong?  I'm not even sure where to start with something like
>   this, but I have to imagine it's been done before.

How about a cron job to drop a .call file on your PBX which will go to a
context like this:

exten => s,1,Dial(ZAP/g1/xxxxxxxx,30)
exten => s,2,gotoif(${DIALSTATUS}="unanswered",10)
exten => s,3,noop(allok)
exten => s,4,Hangup
exten => s,10,noop(BAD)
exten => s,11,system(mail -s "Customer PBX XXX is not answering calls"
noc at domain.com)
exten => s,12,hangup

You will need to look at priority 2, and fix that to work, I didn't look
at the usage/etc for that.

Regards,
Adam




More information about the asterisk-users mailing list