Running a function/agi when a phone is picked up

Hi,

Searched for this on the forums, but couldn’t find any information. Apologies if this was already answered.

I successfully created an AGI script that runs on every incoming call, by creating a [from-pstn-custom] macro.

My question is how can I run it only when an extension is actually picked up? I want it to run only when someone actually picks up the phone.

Thanks for your time.

No one knows?