[Chicago-talk] transl. php to perl?

Warren Smith warren at warrenandrachel.com
Tue Mar 29 10:32:42 PST 2005


Try changing this line:
open(CS, ">call_id_test");
to this line:
open(CS, ">>call_id_test");

Depending on your dialplan, send_clid.agi may be executed twice. Also check that send_clid.agi has permissions 755.
Everything else looks okay, however, wall expects a filename to write to everyone. I.E. wall call_id_test instead of wall $clid.
Hope this helps. You can see what other neat variables asterisk sends you by:

use Data::Dumper;
print CS Dumper(\%input);

-Warren

On Tue, 2005-03-29 at 08:47 -0800, Richard Reina wrote:
> Warren, 
> 
> I think I'm getting a little closer.  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 reload.
> 
> use Asterisk::AGI;
> my $agi = Asterisk::AGI->new();
> my %input = $agi->ReadParse();
> 
> my $clid = $input{callerid};
> my $dnid = $input{dnid};
> 
> open(CS, ">call_id_test");
> print CS "INCOMING CALL FROM " . $clid . "\n";
> print CS $dnid . "\n";
> close(CS) || die "can't close\n"; 
> system("wall $clid");
> 
> The >cli seems to indicate it worked:
> Launched agi script
> /var/lib/asterisk/agi-bin/send_clid.agi
> AGI script send_clid.agi completed, returning 0
> 
> however I see no output from wall and if I do a cat
> call_id_test it's empty.  call_id_test has permission
> set to 777.
> 
> Any idea what I'm doing wrong?
> 
> Thanks, again for all the help thus far.
> 
> Richard
> 
> --- Warren Smith <warren at warrenandrachel.com> wrote:
> 
> > In my [incoming] context (where all my zapata calls
> > go), this is the
> > first thing executed. I.E.
> > 
> > exten => s,1,AGI(send-clid.agi)
> > exten => s,2,Background(greeting)
> > ...
> > 
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
> 



More information about the Chicago-talk mailing list