How to transfer to extension after call?


I would like to execute some script after call is finished. It is attached to extension 7999 in extensions_custom.conf:

exten => 7999,1,Goto(quiz,s,1)

exten => s,1,Verbose(2,Starting quiz)
exten => s,2,Playback(custom/q_hi)
exten => s,3,Read(a1,1,n,2,10)
exten => s,4,Verbose(2,Answered ${answ})
exten => s,5,AGI(quiz.php,1,${a1})
exten => s,n,Hangup()

How can I automatically transfer a call there after hangup?