Running AGI script before hangup

Hello! I want to run AGI script before hanging up calls that came from queue.
Is that possible?

Thanks!