[Asterisk-Users] How to detect AGI script failure?

Alex Hutton alex.hutton at adaptime.net
Thu Nov 3 06:34:43 MST 2005


Hello,

I'm new to the list so I hope I'm asking the question in the right 
place.  In our extensions.conf, we call an AGI script using the AGI command.

e.g.

exten => 11,1,Answer
exten => 11,2,Wait(0.5)
exten => 11,3,Playback(welcome1)
exten => 11,4,agi(agi://192.168.1.88/hello.agi?src=test|${CALLERID})



If for some reason, the AGI script fails to run (e.g. our AGI prog isn't 
running), can we detect it and direct the call to a pre-recorded message?

When I look at the documentation, it says agi returns -1 if there is a 
problem, which (as far as I understand) means the call is hung up. I 
don't know how to detect this condition and handle the call appropriately.

Thanks for any help,

Alex



More information about the asterisk-users mailing list