Arpit Mehta
2007-Nov-02 20:04 UTC
[asterisk-users] use dial plan passed arg value in C agi code
Hello * users, I know that passing variable in the AGI script is by exten => _.,1,AGI(simple_c_prgm|123|789) ; 123, 789 are arguments being passed and simple_c_prgm is C code 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? Thanks Regards -- Arpit Mehta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20071102/d2a9666c/attachment.htm
Eric "ManxPower" Wieling
2007-Nov-02 20:15 UTC
[asterisk-users] use dial plan passed arg value in C agi code
Asterisk used to NOT support more than one arg to an AGI. I thought this was fixed in 1.2, but since I now use dialplan variables to pass data to AGIs, I don't know if it really was fixed or not. Arpit Mehta wrote:> Hello * users, > > I know that passing variable in the AGI script is by > > exten => _.,1,AGI(simple_c_prgm|123|789) ; 123, 789 are arguments being > passed and simple_c_prgm is C code > > 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? > > Thanks > > Regards > > > ------------------------------------------------------------------------ > > _______________________________________________ > --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 >
James FitzGibbon
2007-Nov-02 20:54 UTC
[asterisk-users] use dial plan passed arg value in C agi code
On 11/2/07, Arpit Mehta <am2866 at columbia.edu> wrote:> > Hello * users, > > I know that passing variable in the AGI script is by > > exten => _.,1,AGI(simple_c_prgm|123|789) ; 123, 789 are arguments being > passed and simple_c_prgm is C code > > 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?
Eric "ManxPower" Wieling
2007-Nov-02 21:10 UTC
[asterisk-users] use dial plan passed arg value in C agi code
James FitzGibbon wrote:> On 11/2/07, Arpit Mehta <am2866 at columbia.edu> wrote: >> Hello * users, >> >> I know that passing variable in the AGI script is by >> >> exten => _.,1,AGI(simple_c_prgm|123|789) ; 123, 789 are arguments being >> passed and simple_c_prgm is C code >> >> 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? > > >>From the wiki (http://www.voip-info.org/wiki-Asterisk+AGI): > > 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. > > These docs, while dated, are also useful: > > http://www.bitflipper.ca/Documentation/agi.html > > It even includes code for getting at variables from several languages.Sadly those docs cover the situation of this: exten => 666,1,Set(MY_VAR=fred) exten => 666,n,AGI(simple_c_prgm) Not this: exten => 666,1,AGI(simple_c_prgm|123|789)