[Asterisk-Users] Playing GSM files(s)

Juan Cardenas jaycard at bellsouth.net
Thu Feb 12 08:53:53 MST 2004


I know this is not a perl user list but it has to do with something I'm
trying to get working with Asterisk. I'm trying to create an AGI script
that can play all files in a directory. Hopefully get it to the point
where the user can hit '2' to continue and 'anyotherkey' to exit.
This is what I have so far.... Any ideas?

#!/usr/bin/perl

use Asterisk::AGI;

$AGI = new Asterisk::AGI;

my %input = $AGI->ReadParse();
my $directory = '/var/lib/asterisk/test';
my $file =0;

{
opendir(DIR, $directory) || die "can't opendir $directory: $!";
foreach grep {/^msg} readdir(DIR) $file="$message";

close DIR;
}
print "STREAM FILE $message";


I know it's sloppy I need serious perl lessons, can anyone give some
advice?





More information about the asterisk-users mailing list