FreePBX and AgentConnect Event

Hi Asterisk-gurus,

I am looking for a way, to make Asterisk doing “something” after an agent of a queue picked up the phone…
Does somebody know how I achieve that?

To be a bit more specific:
I am using FreePBX, and using the unsupported module “Dialplan Injections” (by naftali5), my Asterisk is doing a system command to open a php-file on my (external) webserver, and add some information to a database: CALLID, TIMESTAMP, CALLFROM, CALLTO and EXTENSION. While the call isn’t taken yet by an agent, the EXTENSION is 000.
Now I want to update the database automatically, when an agent picked up the phone, and the customer is connected to one specific agent. How do I do that, without hacking the conf-files? When changing the conf-files, I cannot use FreePBX anymore…

you need to capture the AgentConnect event [there are also useful AgentComplete, AgentCalled, AgentDump events] and then use that to trigger whatever you want to do.

A useful way to learn is to install an open source listener that captures all events and dumps them into a database. Look at that code and you can quickly see how to modify it to just pick out events you are interested in and write whatever process you like when those events are received.

A good start is ProxyMan [http://micpc.com/eventmonitor/] which you can install in a few minutes and figure out what you want to do next.