Queue Wrap-Up time and processing

I was looking for a way to place the agent into post-call/wrap-up state when the call hangs up. I am using Asterisk 1.6 and fpbx 2.9.rc1.4. Even though i setup wrap-up time to be 30 seconds for a queue, i don’t see any queue state change after I disconnect from the caller. I would also like to be able to programmatically set the agent to idle state. I was thinking of doing that with AMI interface. I have been googling for quite some time, but so far only found people with the same type of problems. Btw, all my agents are statically configured for each queue. I have a small app that monitors events from AMI, but even there i don’t see an event with pause duration or anything like that. Can anyone assist?