[Asterisk-Users] Two problems with the Perl AGI

vagabond_ast vagabond_ast at tiscali.fr
Tue Dec 28 13:09:39 MST 2004


Hi,

I have a * 1.0.3 running on a Gentoo box and I installed Perl AGi from
http://asterisk.gnuinter.net/files/asterisk-perl-0.08.tar.gz.

When I write this :

>#!/usr/bin/perl
>use Asterisk::AGI;
>my $AGI = new Asterisk::AGI;
>$AGI->exec ('Dial SIP/kphone1|30|tTr');
>my $duration = $AGI->get_variable('ANSWEREDTIME');
>print STDERR "\n duration : $duration\n";
>exit (0);

I obtain, on the CLI

> *CLI>
>   duration :

before the callee takes the call.

I tried this (sorry, it's ugly) :

>#!/usr/bin/perl
>use Asterisk::AGI;
>my $AGI = new Asterisk::AGI;
>$AGI->exec ('Dial SIP/kphone1|30|tTr');
>my $status = 0;
>while (!$status)
>{
>  $status = $AGI->get_variable('DIALSTATUS');
>}
>my $duration = $AGI->get_variable('ANSWEREDTIME');
>print STDERR "\n duration : $duration\n status  : $status\n";
>exit (0);

and it gives me :

>*CLI>
> duration ANSWER
> status  : ANSWER

In my extensions.conf I have :
>exten => 600, 1, Answer
>exten => 600, 2, DeadAGI(test.agi)
>exten => 600, 3, Hangup

Does someone see where is the problem?

Thanks,

Alex
  
-- 
vagabond_ast <vagabond_ast at tiscali.fr>




More information about the asterisk-users mailing list