#!/usr/bin/perl

use Asterisk::AGI;

$fpath = '/tmp/agi-irc-irc.pipe';
my $AGI = new Asterisk::AGI;

unless (-p $fpath) { die "Cannot open $fpath.  This probably means that the AGI IRC component is not running\n"; }

while(1) {
  sysopen(FIFO, $fpath, O_RDONLY);
  while(<FIFO>) {
    $test =~ s/\"/ /g;
    $AGI->exec('Festival', "\"$_\"");
  }
close FIFO;
}
