Hi
i want use the API on my asterisk 1.6, but i have a small problems :
In extension, i start it :
exten => _X.,3,AGI(My-Script.agi)
The perl agi file are started without problems
but i want get into this script a lot of variable:
Type (SIP or IAX)
src (from cdr)
but that's don't work:
use Asterisk::AGI;
use lib "/var/lib/asterisk/agi-bin";
$AGI = new Asterisk::AGI;
$typ = $AGI->get_variable('agi_type');
$typ don't have SIP or IAX, same test without succes:
$typ = $AGI->get_variable('type');
anyone know this problems ?
thanks
Olivier
Hello!
Try to use ${CHANNEL} instead of agi_type.
It will be like this:
$typ = $AGI->get_variable('CHANNEL');
@tmp_array=split(/\//, $typ);
$typ = $tmp_array[0];
and
$src=$AGI->get_variable('cdr(src)');
On 05.03.2011 10:25, Olivier CALVANO wrote:> Hi
>
> i want use the API on my asterisk 1.6, but i have a small problems :
>
> In extension, i start it :
> exten => _X.,3,AGI(My-Script.agi)
> The perl agi file are started without problems
>
> but i want get into this script a lot of variable:
> Type (SIP or IAX)
> src (from cdr)
>
> but that's don't work:
>
> use Asterisk::AGI;
> use lib "/var/lib/asterisk/agi-bin";
> $AGI = new Asterisk::AGI;
> $typ = $AGI->get_variable('agi_type');
>
> $typ don't have SIP or IAX, same test without succes:
> $typ = $AGI->get_variable('type');
>
> anyone know this problems ?
>
> thanks
> Olivier
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
> http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
On Sat, 5 Mar 2011, Olivier CALVANO wrote:> i want use the API on my asterisk 1.6, but i have a small problems : > > $typ don't have SIP or IAX, same test without succes: > $typ = $AGI->get_variable('type');'agi_type' is part of the AGI environment, not a channel variable. Read the documentation for your AGI library to see how to access the AGI environment variables -- the cruft Asterisk writes to the STDIN of your AGI before any of your requests. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000