Running a script when call hangs up in queueu

Hi,
I’d like run a script when a caller, which is waiting in a queue, hangs up.
Does anybody have an idea how and where to add that in the dialplan?

Thanks,

Leiste

Asterisk 1.6.2.17.2

“h” extension.

hi,
“h” extension is fine - but how can I ensure, that the “h” extension is only used, when the caller hangs up while waiting in a queue? I don’t want to run the “h” extension every time.

I will use it for a service desk. Everytime a caller stops waiting and hangs up, he should get an email!

Thanks

The easiest way is probably to use AMI and handle the abandoned event.