If you just want to call a program then just go ahead and call it using the Asterisk system command. It doesn't need to be an agi. There is an example in the included utilities custom app...
;
; send daily CDRs to owner
;
exten => *903*,1,system(/etc/selintra/daycall ${CALLERIDNUM})
exten => *903*,2,GoTo(utilend,1)
It calls a routine (daycall) with the callerid as a parameter.
Best
S