You can easily achieve this via the freeswitch's API on port 8021.
I've done it before and listen to the following events to trigger actions.
"member-queue-start"
"member-queue-end"
"bridge-agent-start"
Just use some free-switch listener and listen for these events. it should work.