[asterisk-users] use dial plan passed arg value in C agi code

James FitzGibbon james.fitzgibbon at gmail.com
Fri Nov 2 16:29:35 CDT 2007


On 11/2/07, Eric ManxPower Wieling <eric at fnords.org> wrote:
>
> 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)


Looking back over it, you're right.

However, multiple args passed to the AGI work fine; they come in the same
way as any standard argc/argv program.

i.e.:

AGI(agentpause.agi
,--mode=pause,--autopause,--agent=${AGENTCODE},--pausereason=${PAUSEREASON})

I handle this (in Perl) using Getopt::Long, which knows nothing of AGI's
stdin/stdout mechanics:

GetOptions(
  \%opts,
  'mode=s',
  'agent=i',
  'pausereason=i',
  'autopause!',
) or die "can't parse command line";
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20071102/bc307ee0/attachment.htm 


More information about the asterisk-users mailing list