DeadAGI: Executes on hungup channel issue with asterisk-1.8

I have installed asterisk- and trying to use DeadAGI & its not working on dead(hangup) channel as its working with asterisk-1.4. Are any other way to run AGI function on dead(hangup) channel, if DeadAGI is work with asterisk-1.8.X then how? please help

DeadAGI is no longer supported by Asterisk-1.8. see below lines from

“In versions of Asterisk prior to 1.8, there was a dialplan application called DeadAGI(). Its purpose was similar to that of AGI(), except you used it on a channel that had already been hung up. This would usually be done in the special h extension, when you wanted to use an AGI application to aid in some type of post-call processing. Invoking DeadAGI() from the dialplan will still work, but you will get a WARNING message in the Asterisk log. It has been deprecated in favor of using AGI() in all cases. The code for AGI() has been updated so it knows how to correctly adjust its operation after a channel has been hung up.”