http://www.voip-info.org/wiki/view/Asterisk+cmd+DeadAGI read the part at the bottom about ignoring sighup, if you're using a later version i think there is a option like agisighup that you can use in the dialplan