Passing variables with agi

hi all…

i’m trying to pass some variables from the dialplan to an external script using the agi interface. so i do AGI(myscript|${var1}|${var2})
that’s fine but how do i get those variables on the other end - are they supposed to be as command line variables? i didn;t find anything about it when reading about the agi_ variables that asterisk passes on…

so are $var1 and $var2 to be trated as argv?!

thanks…

ok… the answer is yes… the variables are passed as if they were command line arguments. so they can be read with argv[1], argv[2], etc…

i didn;t find this anywhere so here…

Can I ask where you were able to find good info on the AGI?

did you look in the wiki ??

voip-info.org/wiki-Asterisk+AGI

Yea I’ve looked here just thought you might have some additional resources. Thanks though.

AGI is very similar to CGI (common gateway interface). There are a plethora of CGI examples/tutorials on the web.

You may have already gone down this path, but if not, I think you’ll find a great deal of the concepts in CGI can be applied to AGI.