[Asterisk-Users] Re: Asterisk Question

Michael Collins mcollins at fcnetwork.biz
Wed Mar 1 00:46:53 MST 2006


> Thanks for this example - it has really got me started!
> 
> Short question - how can I put a variable into my perl script?
> 
> I imagine it's something like
> exten => 780,1,AGI(agi_ret_val2.pl|${back})
> 
> But how can I get my perl script to pick this value up?
> 
> Again - thanks to everyone who has helped me with this.
> 

Paul,

You can also set an Asterisk variable and access it with the
get_variable method of Asterisk::AGI:

extensions.conf:
exten => 780,1,SetVar(MyVar=test)
exten => 780,n,AGI(agi_ret_val2.pl)


In agi_ret_val2.pl:

my $var = $agi->get_variable('MyVar');

I'm using this with a proof on concept script.  I'll post it tomorrow
when I'm done.

-MC



More information about the asterisk-users mailing list