[asterisk-dev] AGI and DeadAGI

Matthew Nicholson mnicholson at digium.com
Tue Jul 24 13:34:23 CDT 2007


Peter Beckman wrote:
> On Tue, 24 Jul 2007, Matthew Nicholson wrote:
> 
>> Matt Riddell wrote:
>>>
>>> Are we fine using AGI in this situation?  If so, I'll update the wiki to
>>> be a bit more verbose.
>>>
>>
>> A running AGI script should not be terminated when the line is hung up.
>>  Asterisk should send the script SIGHUP when it closes the pipe to the
>> script.  After the SIGHUP is sent, attempts to communicate with asterisk
>> will result in SIGPIPE.
>>
>> Properly handling SIGHUP and SIGPIPE should prevent your scripts from
>> automatically getting terminated.
> 
>  If I'm using AGI() and there is a hangup or a disconnect or congestion, do
>  I get a final status of the call?  Or must I then use a dialplan that
>  executes deadAGI() in order to get the channel variables such as
>  DIALSTATUS in order to do custom CDRs and such?

Well, once the SIGHUP is sent, you no longer will be able to get channel 
variables from asterisk.  If you did something like 'EXEC Dial Zap/1' 
you may be able to get the DIALSTATUS from asterisk before the SIGHUP if 
the originating channel is still up.

The most straight forward way to do that is just to execute a DeadAGI 
from the 'h' exten.
-- 
Matthew Nicholson
Digium



More information about the asterisk-dev mailing list