On 11/2/07, <b class="gmail_sendername">Arpit Mehta</b> <<a href="mailto:am2866@columbia.edu">am2866@columbia.edu</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello * users, <br><br>I know that passing variable in the AGI script is by <br><br>exten => _.,1,AGI(simple_c_prgm|123|789) ; 123, 789 are arguments being passed and simple_c_prgm is C code<br><br>Now how will I receive these variables within C code ? Is it by the same way arguments are passed in command line to C by using argc and argv or there is more to be done than that?
</blockquote><div><br>From the wiki (<a href="http://www.voip-info.org/wiki-Asterisk+AGI">http://www.voip-info.org/wiki-Asterisk+AGI</a>):<br><br>When Asterisk starts an AGI script, it feeds the channel variables to
the script on standard input. The variable names are prefixed with
"agi_" and are separated from their values by a colon and a space.
Though the actual channel variables may be in the upper case, the names
passed to an AGI script are all lower case. Also, some channel variable
names as passed to AGI script differ from the current variable names
used in the dial plan.<br></div></div><br>These docs, while dated, are also useful:<br><br><a href="http://www.bitflipper.ca/Documentation/agi.html">http://www.bitflipper.ca/Documentation/agi.html</a><br><br>It even includes code for getting at variables from several languages.
<br><br>-- <br>j.