Call agi script for Caller Id Lookup Source

In my conversion from a bare Asterisk to FreePBX, i’m trying to find the best solution for CallerID lookup.
I have a custom made script that needs to be run, and i can’t seem to find out how i can do this elegantly in FreePBX.
Thanks in advance.

Doing it through HTTP would be much easier than an AGI if you want to do it through the web GUI

Yeah i know. But we need two things doing, where one of the things is a nohup call on linux (because it’s duration is over 4 sec).
Is there a special place i can make a hook in the dialplan?

Assuming you have your trunks set up in a conventional manner, this should work:

[from-pstn-custom] ; this line should run on every inbound trunk call exten => _X.,1,AGI( ... )