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();
$AGI->say_number(1984);
exit(3);
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”.
A hello-world.sh
#!/bin/bash
while read VAR && [ -n ${VAR} ] ; do : ; done
echo "ANSWER"
read RESPONSE
echo 'SAY ALPHA "Hello World" ""'
read RESPONSE
exit 0
works as expected.
I