Custom Destination to exceute a php script

Hi All,
I need some help and advice in setting a custom destination to that when called, it executes my own php script. Any ideas are welcome.
Thanks,
Daniel

Simply write a short dialplan sequence to call your code in /etc/asterisk/extensions_custom.conf

Use misc. destination in FreePBX to reach your custom dialplan.

Thanks alot,

I have tried it out with a sample agi script and it executes perfectly.
Am pretty new to agi scripting but i have been using vxml on my cisco call manager.
Here is a extract of a sample script i have been processing on the cisco



Basically what that does is it picks out the caller id of the person calling, appends a + 254 to it, adds a default message body to it and posts to the url.
Any hints of how i can write the agi script for it.

Thanks

Daniel