Perl agi's not run

I’m trying to run a perl agi, but nothing happens.
The file is in the right place and executable, beause I get errors if they aren’t

with agi debug on and verbose high, I can see the script is launched and sent data, but nothing is returned.

   -- Launched AGI Script /var/lib/asterisk/agi-bin/hello-world.agi
<SIP/hovednr-00000016>AGI Tx >> agi_request: hello-world.agi
<SIP/hovednr-00000016>AGI Tx >> agi_channel: SIP/hovednr-00000016
<SIP/hovednr-00000016>AGI Tx >> agi_language: da
<SIP/hovednr-00000016>AGI Tx >> agi_threadid: 140380200761088
<SIP/hovednr-00000016>AGI Tx >>
    -- <SIP/hovednr-00000016>AGI Script hello-world.agi completed, returning 0

The script is simply

#!/usr/bin/env perl
use Asterisk::AGI;

$AGI = new Asterisk::AGI;
%input = $AGI->ReadParse();


Even if the script does an exit(3) it still say hello-world.agi completed, returning 0
If I run the script by hand, and hits the enter-button, i.e. feeding it \n, the script produces output, so it is “working”.



while read VAR && [ -n ${VAR} ] ; do : ; done

echo "ANSWER"

echo 'SAY ALPHA "Hello World" ""'

exit 0

works as expected.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.