There is actually a much easier way to do this than handlers.
Make sure you have enabled "Track Routing Exceptions" in IA -> Interaction Tracker -> Configuration -> Items Tracked tab. This will track abandons, flow outs and transfers in the DB in their own respective tables/views, down to the millisecond. For abandons, it lists them with the queue in which they abandon, the time they abandon, how long they were in the queue, and the callidkey. If more data is desired, you can use the CallIDKey and join to other tables in the DB as well.
After enabling, have a look at the EE_AbandonEvents_viw view in the DB.