[HELP] how 2 detect whether caller or callee hung up a call?

Hi,

does anyone know how I can detect (probably with deadagi?)
whether the caller or the callee hung up the call in Asterisk??

Thanks a lot for any suggestions,
Robert