Help, Simple AGI script

well well …

im kinda new to asterisk, i need to make an AGI script that sets a CHANNEL variable that i can read from the dialplan with some number ( let`s call the variable $serial ).

exten => 123,n,AGI(getvar.agi)
exten => 123,n,SayDigits(${serial})

P.S. if anyone has any source that teaches AGI-PHP in a nice easy way please share, i tried the oreilly book but it`s too complicated for me when it comes to AGI.

tanks

Have a look at:
voip-info.org/wiki/view/set+variable

You want something like:
$agi->set_variable(‘serial’, ‘12345’);

From the asterisk dial plan the variable serial will have the value of 12345.