Executing AGI -

Hi All,

I am currently facing an issue on AGI with perl. Here, whenever the AGI script auto_call.pl is run, in the console the asterisk shows the message given below:

[quote]
– Attempting call on SIP/1001 for s@ivr-asterisk:1 (Retry 1)
> Channel SIP/1001-081a88b0 was answered.
– Executing Answer(“SIP/1001-081a88b0”, “”) in new stack
– Executing AGI(“SIP/1001-081a88b0”, “auto_call.pl|s”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/auto_call.pl
Use of uninitialized value in concatenation (.) or string at /usr/local/share/perl/5.8.8/Asterisk/AGI.pm line 1049.
– AGI Script auto_call.pl completed, returning 0
– Executing Hangup(“SIP/1001-081a88b0”, “”) in new stack[/quote]

The script auto_call.pl script is given below:

[code]#!/usr/bin/perl

use Asterisk::AGI;
$BGI=new Asterisk::AGI;
$filename=test123;
$BGI->stream_file(‘test123’);
[/code]

Please go through and do suggest some tips/ideas. Thanks in advance.

Regards,

Kurian Thayil.

Try this…

#!/usr/bin/perl use strict; use Asterisk::AGI; my $AGI = new Asterisk::AGI; my %input = $AGI->ReadParse(); my $filename='test123'; $AGI->stream_file($filename);

always use strict and you can verify it compiles with perl -c

Hi,

Thanks for the reply. I delibrately avoided the use of Strict. It throws lot of warning messages. I wanted to implement this in BASH which I couldn then (so thought of doing in Perl even though im terrible in it). Now the issue got settled with BASH itself. Thank you.

Regards,

Kurian Thayil.