Running AGI problem

Hi Al.
I am wanting to record a bit of data to a file when a call is from a specific CID, and thought that using AGI might be the way to write the data to a file (via PHP), but not 100% sure.

I am using the following code in extensions.conf:-

[macro-exten-vm]
exten => s,n,ExecIf($["${CALLERID(name)}" = “ThePerson”]|AGI(logdata.php))

I have set the user of “logdata.php” to being asterisk and also I am writing the file to a dir that has write access, but I must b doing something wrong, as if I run the part o the PHP that writes to the file (via http), it will write to the file, but when the above code runs nothing happens. Infact It fails at this line and doesnt do some other stuff after the above line of the extensions.conf file
So I can safely assume I am doing something wrong. :slight_smile:

Can someone assist??

Thanks, Jeremy

Well I can answer my own question here.

Al I did wrong was how I was calling the AGI. IT should be :-

exten => s,n,ExecIf($["${CALLERID(name)}" = “ThePerson”]|AGI,logdata.php)

I thought I would reply so others can benefit…and when I search for this again in about 6mths when I have forgotten how to do it, I will get an answer :slight_smile:

Jeremy