[asterisk-users] AGI/PHP: missing arguments

Nasir Iqbal nasir at ictinnovations.com
Sat Sep 15 13:24:25 CDT 2007


Hi Michael,

Actually parameter passed to AGI script are not "Channel Variables" and
they passed to PHP/AGI directly so you cannot access them using STDIN. 

to access passed parameters simply use global variable argv like.

    global $argv;

    //Getting input data (Parameter Passed to Script)
    $callerID  = $argv[1];


Regards

Nasir Iqbal
ICT Innovations
http://ictinnovations.com


On Sat, 2007-09-15 at 18:21 +0200, Michael Kamleitner wrote:
> hi folks,
> 
> I've built a simple PHP-script utilizing the AGI-interface. in
> extensions.conf I trigger the script and pass a single value as first
> argument:
> 
> exten => h,1,DeadAGI(process.php|${Enter})
> 
> On the Asterisk-console, I can actually see that the script is called
> correctly (something like "DeadAGI(process.php|1234)"). However, when
> I read stdin in the PHP script, I receive all AGI-environment
> variables (agi_request, agi_callerid etc.) correctly, but I'm missing
> the actual passed value (which should be in agi_arg_1 etc.). the last
> thing I get from stdin is the environment-variable agi_accountcode,
> after this it seems to stop. 
> 
> what's really strange is, that the exact same script has been working
> correctly on a different machine...
> 
> any suggestions highly appreciated, thx!
> 
> regards,
> michael
> _______________________________________________
> 
> Sign up now for AstriCon 2007!  September 25-28th.  http://www.astricon.net/ 
> 
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list