hello all,
I tryed to do an callback agi in perl
but it don’t work
i don’t know if it is my asterisk or my script which don’t work!
thank you
my scipt:
#!/usr/bin/PERL
use Asterisk::AGI;
$AGI = new Asterisk::AGI;
my %input = $AGI->ReadParse();
my $caller id = $input{‘caller id’}; # on recuperer le callerid
normalisation du numero passe {country code}{number}
suppression des caracteres non numeriques
$callerid =~ s/[^\d]//g;
#mise en forme du fichier .call dans le spooler de asterisk
open (FSOR,’>>/var/spool/asterisk/outgoing/rappel.call’);
print FSOR “Channel : $callerid \nMaxRetries: 3 \nRetryTime: 40 \waittime: 25 \context: $context \extension: $extension \priority: 1 \n”;
close FSOR;
you shouldn’t create the .call file in the outgoing directory … create it somewhere else and move it when you’re finished writing to it. otherwise, the way Asterisk agressively scans the directory can cause problems with open files. make sure you get the right permissions on the file too.
4th time lucky. post all your code here. we’ve seen the extensions.conf entry, now we need to see the call file your Perl script creates, and the Perl script itself.
ok, i’ll try again. here is an example i justr knocked up. you call 1000, it writes the .call file and hangs up. then you get a call and it dumps you out to *63, my extension for an echo test.
rap.agi[code]#!/usr/bin/perl -w
use Asterisk::AGI;
my $AGI = new Asterisk::AGI;
my %input = $AGI->ReadParse();
my $extension = $input{“callerid”}; # Where we’re going to call
write file
my $myfile = “/var/spool/asterisk/”.$extension.".call";
my $destfile = “/var/spool/asterisk/outgoing/”.$extension.".call";
[quote=“fcois93”]i give you my log screenshot[/quote]that’s nice. not sure what to do with it as you haven’t posted any details about the extension or perl you used.