$ 0 0 I see no attempts at debug output, AGI writes to stdout and reads from stdin, php can do that also. Start here:- http://www.voip-info.org/wiki/view/Asterisk+AGI+php