[Asterisk-Users] callerid send to shell script with system command

duncan duncan at impede.net
Tue Apr 29 15:30:31 MST 2003


>anyone has a idea how to send caller id (incoming number)
>to shell script like:
>
>exten => s,1,wait,2
>exten => s,2,System(/bin/script callerid-number)
>exten =>s,3,answer
>
>i need to run script in shell with command line like "/bin/script -a 
>123456789 "
>this 123456789 must be callerid (incoming call) number.

well no, but i know how to do it in AGI

exten => s,1,wait,2
exten => s,2,AGI,shell.agi

then create a file called shell.agi in the /var/lib/asterisk/agi-bin/ 
directory (make sure it has the right permissions - chmod 774 shell.agi i 
think) containing this (again i think - not tested code):

#!/usr/bin/perl
use Asterisk::AGI;
$AGI = new Asterisk::AGI;
my %input = $AGI->ReadParse();
my $callerid = $input{'callerid'};

system(/bin/script $callerid);


hope this helps


duncan




More information about the asterisk-users mailing list