[Asterisk-Users] Asterisk::AGI script won't work?

Jean-Michel Hiver jhiver at ykoz.net
Wed Mar 30 07:46:53 MST 2005


Richard Reina wrote:

>I installed the AGI perl library then put the
>following script in a file called
>/var/lib/asterisk/agi-bin/send_clid.agi,
>updated my [incoming] context with exten =>
>s,1,AGI(send_clid.agi) and did a restart now.
>
>use Asterisk::AGI;
>my $agi = Asterisk::AGI->new();
>my %input = $agi->ReadParse();
>
>my $clid = $input{callerid};
>my $dnid = $input{dnid};
>  
>
1st rule with Perl scripts: use strict;
2nd rule: use warnings;

Then.

Are you sure about the capitalization?

I.e. if the variable is ${CALLERID} in asterisk,

You should use $agi->get_variable ('CALLERID') I think.


>open(CS, ">>call_id_test");
>  
>
You should use an absolute path, i.e.

/tmp/call_id_test


>print CS "INCOMING CALL FROM " . $clid . "\n";
>print CS $dnid . "\n";
>close(CS) || die "can't close\n"; 
>system("wall $clid");
>  
>
On my system, wall takes input from STDIN. So

open FP, "|wall";
print FP "CLID: $clid";
close FP;

Might work better.

Regards,
Jean-Michel.

-- 
Ykoz Un Max - La VoIP en pré-payé!
Essayez gratuitement - 5 crédits offerts.
---> http://ykoz.net/voip/max <---





More information about the asterisk-users mailing list