Agent Survey

Hi to all, im here new at the Forum, im trying to make a crazy stuff.

I need that when an agent hang up a call, the call go to an agi automatically, rigth now i can make this if i use static agents based on extension number, i just modify macro hangup, but i need to use dinamyc agents based on agents configure in agents.conf, and this is when it stops working, i think thi is because chan_agent does not use macro-hangupcall, anyone have any idea how can i make this¡