Thanks for posting it out! I might add that to the FAQ or documentation in the future. Just for your information, the next fop release will have initial support for callback hooks in Perl. I am doing it in order to fire some custom dialplan applications when presence is changed (This way you can actually set your phone into DND in FreePBX when you set it in fop2 without the need to override freepbx dialplan). I am using it currently to set agents on pause.
Best regards,