Index: res/res_agi.c =================================================================== --- res/res_agi.c (revision 10223) +++ res/res_agi.c (working copy) @@ -1902,8 +1902,11 @@ } /* Notify process */ if (pid > -1) { - if (kill(pid, SIGHUP)) - ast_log(LOG_WARNING, "unable to send SIGHUP to AGI process %d: %s\n", pid, strerror(errno)); + const char *nohup = pbx_builtin_getvar_helper(chan, "AGINOHUP"); + if (ast_strlen_zero(nohup) || ast_false(nohup)) { + if (kill(pid, SIGHUP)) + ast_log(LOG_WARNING, "unable to send SIGHUP to AGI process %d: %s\n", pid, strerror(errno)); + } } fclose(readf); return returnstatus;